| 19 | }; |
| 20 | |
| 21 | class Window |
| 22 | { |
| 23 | private: |
| 24 | unsigned int m_width = 1920; |
| 25 | unsigned int m_height = 1080; |
| 26 | int m_style; |
| 27 | std::string m_title; |
| 28 | sf::RenderWindow m_window; |
| 29 | Graphics::Color m_background = Graphics::Color(0, 0, 0); |
| 30 | |
| 31 | public: |
| 32 | explicit Window(vili::node configuration); |
| 33 | void create(); |
| 34 | void clear(); |
| 35 | void close(); |
| 36 | void display(); |
| 37 | /** |
| 38 | * \nobind |
| 39 | */ |
| 40 | void draw(const sf::Drawable& drawable, |
| 41 | const sf::RenderStates& states = sf::RenderStates::Default); |
| 42 | /** |
| 43 | * \nobind |
| 44 | */ |
| 45 | void draw(const sf::Vertex* vertices, std::size_t vertexCount, |
| 46 | sf::PrimitiveType type, |
| 47 | const sf::RenderStates& states = sf::RenderStates::Default); |
| 48 | [[nodiscard]] Transform::UnitVector getSize() const; |
| 49 | [[nodiscard]] bool isOpen() const; |
| 50 | bool pollEvent(sf::Event& event); |
| 51 | void setSize(unsigned int width, unsigned int height); |
| 52 | void setTitle(const std::string& title); |
| 53 | void setVerticalSyncEnabled(bool enabled); |
| 54 | void setView(const sf::View& view); |
| 55 | |
| 56 | Graphics::RenderTarget getTarget(); |
| 57 | sf::RenderWindow& getWindow(); |
| 58 | |
| 59 | [[nodiscard]] Graphics::Color getClearColor() const; |
| 60 | void setClearColor(Graphics::Color color); |
| 61 | void setMouseCursorVisible(bool visible); |
| 62 | }; |
| 63 | } // namespace obe::System |