Class for SDL window creation and management, implemented using the Facade pattern to provide a more intuitive interface.
More...
#include <Window.hpp>
Class for SDL window creation and management, implemented using the Facade pattern to provide a more intuitive interface.
◆ Window() [1/2]
Default constructor - INACCESSIBLE!
◆ Window() [2/2]
pk::Window::Window |
( |
const char * |
windowTitle, |
|
|
glm::ivec2 |
position, |
|
|
int |
width, |
|
|
int |
height, |
|
|
Uint32 |
windowFlags |
|
) |
| |
◆ ~Window()
virtual pk::Window::~Window |
( |
| ) |
|
|
virtual |
◆ clear()
void pk::Window::clear |
( |
glm::ivec4 |
color = glm::ivec4() | ) |
|
Clear the window for rendering with SDL (not OpenGL).
- Parameters
-
glm::ivec4 | color - a glm vector of integers specifying the window clear color. |
◆ draw() [1/3]
◆ draw() [2/3]
void pk::Window::draw |
( |
Drawable & |
drawable | ) |
|
◆ draw() [3/3]
void pk::Window::draw |
( |
Drawable *const |
drawables | ) |
|
Draw an array of Drawable objects in the Window.
- Parameters
-
Drawable | * const drawables - an array of drawables for drawing to the window. |
◆ getClearColor()
const glm::ivec4 & pk::Window::getClearColor |
( |
| ) |
|
|
inline |
Get the clear color of the Window.
- Returns
- glm::ivec4 - the clear color of the Window.
◆ getContext()
SDL_GLContext& pk::Window::getContext |
( |
| ) |
|
|
inline |
◆ getFlags()
const Uint32 & pk::Window::getFlags |
( |
| ) |
|
|
inline |
Get the SDL window flags.
- Returns
- Uint32
◆ getPosition()
glm::ivec2 pk::Window::getPosition |
( |
| ) |
|
|
inline |
Get the position of the window on screen.
- Returns
- glm::ivec2 - window position.
◆ getRenderer()
SDL_Renderer * pk::Window::getRenderer |
( |
| ) |
|
|
inline |
Get the raw SDL_Renderer pointer (read-only).
- Returns
- SDL_Renderer * const - pointer to an SDL_Renderer.
◆ getSDLClearColor()
SDL_Color pk::Window::getSDLClearColor |
( |
| ) |
|
|
inline |
Get the clear color of the Window in SDL_Color format.
- Returns
- SDL_Color - the clear color of the Window.
◆ getSize()
glm::ivec2 pk::Window::getSize |
( |
| ) |
|
|
inline |
Get the SDL window size (width and height).
- Returns
- const glm::ivec2 & - a glm vector of 2 integers.
◆ getTitle()
const char * pk::Window::getTitle |
( |
| ) |
|
|
inline |
Get the window's title.
- Returns
- char * const - a const pointer to a C-style string.
◆ getWindow()
SDL_Window * pk::Window::getWindow |
( |
| ) |
|
|
inline |
Get the raw SDL_Window pointer (read-only).
- Returns
- SDL_Window * const - pointer to an SDL_Window.
◆ getWindowRect()
const SDL_Rect & pk::Window::getWindowRect |
( |
| ) |
|
|
inline |
Get the SDL_Rect belonging to the Window.
◆ render()
void pk::Window::render |
( |
| ) |
|
◆ setFlags()
void pk::Window::setFlags |
( |
const Uint32 & |
flags | ) |
|
|
inline |
Set the SDL window size (width and height).
Set the SDL window flags.
- Parameters
-
const | glm::ivec2 &windowSize - a glm vector of 2 integers. |
Uint32 | flags - a Uint32. |
◆ setPosition()
void pk::Window::setPosition |
( |
glm::ivec2 |
position | ) |
|
|
inline |
Set the position of the window on screen.
- Parameters
-
glm::ivec2 | - x and y coordinates to set the window position to. |
- Returns
- void
◆ setSize()
void pk::Window::setSize |
( |
const glm::ivec2 & |
windowSize | ) |
|
|
inline |
◆ setTitle()
void pk::Window::setTitle |
( |
const char * |
title | ) |
|
|
inline |
Set the title of the window.
◆ setWindowRect()
void pk::Window::setWindowRect |
( |
SDL_Rect & |
rect | ) |
|
|
inline |
Set the SDL_Rect belonging to the Window.
- Parameters
-
SDL_Rect | &rect - Reference to an SDL_Rect. |
◆ m_clearColor
glm::tvec4<Uint8> pk::Window::m_clearColor |
|
private |
SDL_Color for clearing the screen.
◆ m_context
SDL_GLContext pk::Window::m_context |
|
private |
OpenGL context provided by SDL.
◆ m_flags
Uint32 pk::Window::m_flags |
|
private |
Display flags for the SDL_Window.
◆ m_height
◆ m_position
glm::ivec2 pk::Window::m_position |
|
private |
Window position as a vector of integers.
◆ m_rect
SDL_Rect pk::Window::m_rect |
|
private |
SDL_Rect for drawing within a rectangular area of the window.
◆ m_renderer
SDL_Renderer* pk::Window::m_renderer |
|
private |
◆ m_title
const char* pk::Window::m_title |
|
private |
◆ m_width
◆ m_window
SDL_Window* pk::Window::m_window |
|
private |
The documentation for this class was generated from the following file: