148 void SetSize(
unsigned int width,
unsigned int height);
Basic utility macros, typedefs...
uint8_t Uint8
Definition: Util.hpp:17
#define SDLU_BEGIN
Definition: Util.hpp:32
uint32_t Uint32
Definition: Util.hpp:23
Provides a structure for simple vector calculations.
Definition: Cursor.hpp:12
Stores information about a window. You probably want RenderWindow.
Definition: Window.hpp:26
Window(Vector2u dimension, const std::string &title, Uint32 windowFlags)
Creates a window with the given parameters.
bool PollEvent(SDL_Event *event)
A non-blocking event polling function.
virtual void OnCreate()
This function is called after Create() finishes.
virtual void OnClose()
This function is called after Close() finishes.
void SetPosition(int x, int y)
Sets a new window position.
Window(const Window &other)=delete
bool WaitEvent(SDL_Event *event)
A blocking event polling function.
void SetIcon(Uint32 width, Uint32 height, const Uint32 *pixels)
Sets the window icon to an array of RGBA values.
void SetTitle(std::string title)
Sets a new window title.
void SetMouseCursor(SDL_Cursor *cursor)
Changes the mouse cursor.
void Close()
Destroys the window.
void SetIcon(Uint32 width, Uint32 height, const Uint8 *pixels)
Sets the window icon to an array of RGBA values.
Window(Window &&other)=delete
void SetSize(Vector2u size)
Sets a new window size.
void SetVisible(bool visible)
Set the windows visibility.
virtual bool OnResize()
This function is called after a SDL_WINDOWEVENT_RESIZED is polled. (PollEvent() must be called for th...
Window()
Default Constructor. No window is created.
Vector2i GetPosition() const
Returns the current position of the window.
void SetVsync(bool vsync)
(De)activates VSync !globally!
void SetPosition(Vector2i position)
Sets a new window position.
void SetSize(unsigned int width, unsigned int height)
Sets a new window size.
void SetIcon(SDL_Surface *icon)
Sets the window icon to a SDL_Surface.
bool IsOpen() const
Wether or not the window object is created.
void SetMouseCursorGrabbed(bool grabbed)
Traps the mouse cursor inside the window.
SDL_Window * window
Definition: Window.hpp:240
void SetMouseCursor(const Cursor &cursor)
Changes the mouse cursor.
std::string GetTitle() const
Gets the current window title.
Flags
Definition: Window.hpp:28
@ OpenGL
Definition: Window.hpp:30
@ Shown
Definition: Window.hpp:31
@ FullscreenDesktop
Definition: Window.hpp:41
@ Hidden
Definition: Window.hpp:32
@ InputGrabbed
Definition: Window.hpp:37
@ MouseFocus
Definition: Window.hpp:39
@ InputFocus
Definition: Window.hpp:38
@ Fullscreen
Definition: Window.hpp:29
@ Minimized
Definition: Window.hpp:35
@ Borderless
Definition: Window.hpp:33
@ Resizable
Definition: Window.hpp:34
@ Maximized
Definition: Window.hpp:36
@ Foregin
Definition: Window.hpp:40
void SetMouseCursorVisible(bool visible)
Hides/Shows the mouse cursor inside the windos.
SDL_Window *const GetWindow() const
Returns a constant pointer to the SDL_Window.
void Create(Vector2u dimension, const std::string &title, Uint32 windowFlags)
Creates the window.
Vector2u GetSize() const
Gets the current window size.
A struct to handle basic 2D vector operations.
Definition: Vector2.hpp:22