window¶
-
namespace window¶
Functions
-
void init(math::Vec2 size, int scale = 1)¶
Initialize the window.
- Parameters:
size – The size of the window.
scale – The scale of the window.
-
void cls(Color color = {0, 0, 0, 255})¶
Clear the screen.
- Parameters:
color – The color to clear the screen.
-
void flip()¶
Flip the render frame buffer.
Draw a texture using rects.
- Parameters:
texture – The texture to draw.
crop – The rectangle to draw from.
rect – The rectangle to draw to.
Draw a texture to a position.
- Parameters:
texture – The texture to draw.
position – The position to draw at.
Draw a texture using rects.
- Parameters:
texture – The texture to draw.
crop – The rectangle to draw from.
rect – The rectangle to draw to.
angle – The angle to draw the texture.
flipX – Whether to flip the texture on the x-axis.
flipY – Whether to flip the texture on the y-axis.
Draw a texture to a position.
- Parameters:
texture – The texture to draw.
position – The position to draw at.
angle – The angle to draw the texture.
flipX – Whether to flip the texture on the x-axis.
flipY – Whether to flip the texture on the y-axis.
-
SDL_Renderer *getRenderer()¶
Get the window renderer.
- Returns:
The window renderer.
-
bool getFullscreen()¶
Get whether the window is fullscreen or not.
- Returns:
Whether the window is fullscreen or not.
-
int getScale()¶
Get the scale of the window.
- Returns:
The scale of the window.
-
void setTitle(const std::string &newTitle)¶
Set the title of the window.
- Parameters:
newTitle – The new title for the window.
-
std::string getTitle()¶
Get the title of the window.
- Returns:
The title of the window.
-
void setFullscreen(bool fullscreen)¶
Set whether the window is fullscreen or not.
- Parameters:
fullscreen –
true
if setting fullscreen,false
otherwise.
-
void quit()¶
Quit SDL and destroy the window.
-
void init(math::Vec2 size, int scale = 1)¶