This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
DamesEtCo/includes/Ecran.hpp

23 lines
678 B
C++
Raw Normal View History

#pragma once
2023-11-24 20:13:20 +01:00
#include <SFML/Graphics.hpp>
#include <functional>
2023-12-01 16:36:50 +01:00
struct Ecran {
2023-11-24 20:13:20 +01:00
// Fenêtre
2023-12-01 16:36:50 +01:00
static sf::RenderWindow window;
2023-11-24 20:13:20 +01:00
Ecran(const uint width = 800, const uint height = 800,
const std::string name = "Projet"); // constructor
~Ecran(); // destructor
void afficher(
2023-12-28 00:08:53 +01:00
/* Fonction appellée à chaque image */
const std::function<void()> drawEachFrame = {[]() {}},
2023-12-28 00:08:53 +01:00
/* Prend 2 arguments: position X, position Y
* -> appellé à chaque fois que l'utilisateur fait clic gauche */
2023-12-28 00:30:44 +01:00
const std::function<void(const int, const int)> doOnLeftClick = {
[](const int, const int) {}}) const;
2023-11-24 20:13:20 +01:00
};