|
Velvet 0.1a
A beginner-friendly C++ GUI framework built on SFML.
|
Application window and main event/render loop. More...
#include <Window.hpp>
Public Member Functions | |
| Window (int width, int height, const std::string &title) | |
| Create a window. | |
| void | setBackgroundColor (unsigned int hexCode) |
| Set window background color from RGBA hex integer. | |
| void | add (Widget *widget) |
| Add a widget by pointer. | |
| template<typename... Ts> | |
| void | add (Ts &&... widgets_list) |
| Add one or more widgets (pointer or reference forms). | |
| bool | isOpen () |
| Check if the native window is open. | |
| void | run () |
| Start event + render loop. | |
| void | close () |
| Close the window. | |
Application window and main event/render loop.
Window owns the SFML RenderWindow, forwards events to added widgets, and renders widgets each frame.
Typical usage:
|
inline |
Create a window.
|
inline |
Add one or more widgets (pointer or reference forms).
|
inline |
Add a widget by pointer.
The widget must remain alive while the window is running.
|
inline |
Close the window.
|
inline |
Check if the native window is open.
|
inline |
Start event + render loop.
Handles close/resize events, propagates all events to widgets, clears background, renders widgets, and presents the frame.
|
inline |
Set window background color from RGBA hex integer.
Example: 0xE6E6E6FFu