![]() |
Dauphine
0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
|
Represents actual window that game runs on. More...
#include <Window.h>
Public Member Functions | |
| Window (const unsigned int width_, const unsigned int height_, const std::string &title_="SDL Window") | |
| The constructor. More... | |
| ~Window () | |
| The destructor. More... | |
| void | render () |
| Renders to screen. More... | |
| void | clear () |
| Clears the renderer. More... | |
| void | resize (const unsigned int width_, const unsigned int height_) |
| Resizes the window. More... | |
| void | destroy () |
| Frees allocated members. More... | |
| void | minimize () |
| Minimizes window. More... | |
| void | maximize () |
| Maximizes window. More... | |
Static Public Member Functions | |
| static SDL_Renderer * | getRenderer () |
| static void | getLogicalSize (int *w, int *h) |
Private Member Functions | |
| void | create (const unsigned int width_, const unsigned int height_) |
| Creates the Window, with specified width and height. More... | |
| void | rescale (unsigned int size_) |
| Rescales the renderization. More... | |
Private Attributes | |
| const std::string | windowTitle |
| The game Window title. More... | |
| SDL_Window * | sdlWindow |
| The SDL window, that will be the actual game window. More... | |
Static Private Attributes | |
| static SDL_Renderer * | sdlRenderer = nullptr |
| The SDL renderer to render onto. More... | |
Represents actual window that game runs on.
Contains the SDL_Window and the SDL_Renderer, and methods related to these.
| Window::Window | ( | const unsigned int | width_, |
| const unsigned int | height_, | ||
| const std::string & | title_ = "SDL Window" |
||
| ) |
The constructor.
Sets all attributes, and calls the initialize method.
| width_ | : The desired window width. |
| height_ | : The desired window height. |
| title_ | : The desired window title. |
| Window::~Window | ( | ) |
| void Window::clear | ( | ) |
Clears the renderer.
Sets the renderers draw color to black, and subsequently clears it.
|
private |
| void Window::destroy | ( | ) |
Frees allocated members.
Frees the SDL_Renderer and the SDL_Window.
|
static |
| void Window::maximize | ( | ) |
Maximizes window.
Uses SDLs internal method to maximize the window.
| void Window::minimize | ( | ) |
Minimizes window.
Uses SDLs internal method to minimize the window.
| void Window::render | ( | ) |
Renders to screen.
Updates the screen with every change in the renderer.
|
private |
Rescales the renderization.
Set a device independent resolution for rendering.
| size_ | : Multiplies Configuration::resolutionWidth and Configuration::resolutionHeight for the new resolution. |
| void Window::resize | ( | const unsigned int | width_, |
| const unsigned int | height_ | ||
| ) |
Resizes the window.
|
staticprivate |
The SDL renderer to render onto.
|
private |
The SDL window, that will be the actual game window.
|
private |
The game Window title.
1.8.4