Class for managing an SDL window with OpenGL context. More...
#include <Window.hpp>
Classes | |
struct | OpenGL_Context_Settings |
Struct for OpenGL context settings. More... | |
Public Types | |
enum | Position { UNDEFINED = SDL_WINDOWPOS_UNDEFINED , CENTERED = SDL_WINDOWPOS_CENTERED } |
Enum for window position. More... | |
Public Member Functions | |
Window (const std::string &title, int left_x, int top_y, unsigned width, unsigned height, const OpenGL_Context_Settings &context_details) | |
Constructor for the Window class. | |
Window (const char *title, int left_x, int top_y, unsigned width, unsigned height, const OpenGL_Context_Settings &context_details) | |
Constructor for the Window class. | |
~Window () | |
Destructor for the Window class. | |
Window (const Window &)=delete | |
Deleted copy constructor. | |
Window & | operator= (const Window &)=delete |
Deleted copy assignment operator. | |
Window (Window &&other) noexcept | |
Move constructor for the Window class. | |
Window & | operator= (Window &&other) noexcept |
Move assignment operator for the Window class. | |
void | swap_buffers () |
Swaps the OpenGL buffers. | |
unsigned | get_width () |
Gets the width of the window. | |
unsigned | get_height () |
Gets the height of the window. | |
Private Attributes | |
SDL_Window * | window_handle |
Handle to the SDL window. | |
SDL_GLContext | opengl_context |
OpenGL context. | |
unsigned | width |
Width of the window. | |
unsigned | height |
Height of the window. | |
Class for managing an SDL window with OpenGL context.
|
inline |
Constructor for the Window class.
title | Title of the window. |
left_x | X coordinate of the window position. |
top_y | Y coordinate of the window position. |
width | Width of the window. |
height | Height of the window. |
context_details | OpenGL context settings. |
Ragot::Window::Window | ( | const char * | title, |
int | left_x, | ||
int | top_y, | ||
unsigned | width, | ||
unsigned | height, | ||
const OpenGL_Context_Settings & | context_details ) |
Constructor for the Window class.
title | Title of the window. |
left_x | X coordinate of the window position. |
top_y | Y coordinate of the window position. |
width | Width of the window. |
height | Height of the window. |
context_details | OpenGL context settings. |
Ragot::Window::~Window | ( | ) |
Destructor for the Window class.
|
delete |
Deleted copy constructor.
|
inlinenoexcept |
Move constructor for the Window class.
other | Other window to move from. |
|
inline |
Gets the height of the window.
|
inline |
Gets the width of the window.
Deleted copy assignment operator.
Move assignment operator for the Window class.
other | Other window to move from. |
|
inline |
Swaps the OpenGL buffers.
|
private |
Height of the window.
|
private |
OpenGL context.
|
private |
Width of the window.
|
private |
Handle to the SDL window.