17PROMEKI_NAMESPACE_BEGIN
65 SDLWindow(
const String &title,
int width,
int height, ObjectBase *parent =
nullptr);
71 String
title()
const {
return _title; }
90 Point2Di32
position()
const {
return _position; }
150 PROMEKI_SIGNAL(closed)
153 PROMEKI_SIGNAL(moved, Point2Di32)
156 SDL_Window *_sdlWindow =
nullptr;
157 SDL_Renderer *_sdlRenderer =
nullptr;
158 String _title =
"promeki";
159 Point2Di32 _position{0, 0};
160 bool _fullScreen =
false;
163 void destroyWindow();
164 void syncSizeFromSDL();
165 void syncPositionFromSDL();
166 void paintWidget(Widget *widget);
Pumps SDL events into the promeki event system.
Definition sdleventpump.h:37
Top-level SDL window that serves as a root Widget.
Definition sdlwindow.h:47
Point2Di32 position() const
Returns the window position on screen.
Definition sdlwindow.h:90
void hide()
Hides the window.
SDLWindow(ObjectBase *parent=nullptr)
Constructs a window with default size.
void paintAll()
Paints the window and all child widgets.
void move(int x, int y)
Moves the window on screen.
void resize(int width, int height)
Resizes the SDL window.
SDLWindow(const String &title, int width, int height, ObjectBase *parent=nullptr)
Constructs a window with a title and size.
~SDLWindow()
Destructor. Destroys the SDL window and renderer.
void setTitle(const String &title)
Sets the window title.
void update() override
Marks the window as needing a repaint.
bool isFullScreen() const
Returns true if the window is fullscreen.
Definition sdlwindow.h:106
uint32_t sdlWindowID() const
Returns the SDL window ID.
void show()
Shows the window. Creates the SDL window if needed.
SDL_Renderer * sdlRenderer() const
Returns the SDL_Renderer for this window.
Definition sdlwindow.h:134
SDL_Window * sdlWindow() const
Returns the underlying SDL_Window pointer.
Definition sdlwindow.h:118
String title() const
Returns the window title.
Definition sdlwindow.h:71
void setFullScreen(bool fullScreen)
Sets fullscreen mode.