3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::Window Class Reference

Class for managing an SDL window with OpenGL context. More...

#include <Window.hpp>

Collaboration diagram for Ragot::Window:
Collaboration graph

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.
 
Windowoperator= (const Window &)=delete
 Deleted copy assignment operator.
 
 Window (Window &&other) noexcept
 Move constructor for the Window class.
 
Windowoperator= (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.
 

Detailed Description

Class for managing an SDL window with OpenGL context.

Member Enumeration Documentation

◆ Position

Enum for window position.

Enumerator
UNDEFINED 

Undefined position.

CENTERED 

Centered position.

Constructor & Destructor Documentation

◆ Window() [1/4]

Ragot::Window::Window ( const std::string & title,
int left_x,
int top_y,
unsigned width,
unsigned height,
const OpenGL_Context_Settings & context_details )
inline

Constructor for the Window class.

Parameters
titleTitle of the window.
left_xX coordinate of the window position.
top_yY coordinate of the window position.
widthWidth of the window.
heightHeight of the window.
context_detailsOpenGL context settings.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Window() [2/4]

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.

Parameters
titleTitle of the window.
left_xX coordinate of the window position.
top_yY coordinate of the window position.
widthWidth of the window.
heightHeight of the window.
context_detailsOpenGL context settings.

◆ ~Window()

Ragot::Window::~Window ( )

Destructor for the Window class.

◆ Window() [3/4]

Ragot::Window::Window ( const Window & )
delete

Deleted copy constructor.

Here is the call graph for this function:

◆ Window() [4/4]

Ragot::Window::Window ( Window && other)
inlinenoexcept

Move constructor for the Window class.

Parameters
otherOther window to move from.
Here is the call graph for this function:

Member Function Documentation

◆ get_height()

unsigned Ragot::Window::get_height ( )
inline

Gets the height of the window.

Returns
Height of the window.

◆ get_width()

unsigned Ragot::Window::get_width ( )
inline

Gets the width of the window.

Returns
Width of the window.

◆ operator=() [1/2]

Window & Ragot::Window::operator= ( const Window & )
delete

Deleted copy assignment operator.

Here is the call graph for this function:

◆ operator=() [2/2]

Window & Ragot::Window::operator= ( Window && other)
inlinenoexcept

Move assignment operator for the Window class.

Parameters
otherOther window to move from.
Returns
Reference to the moved window.
Here is the call graph for this function:

◆ swap_buffers()

void Ragot::Window::swap_buffers ( )
inline

Swaps the OpenGL buffers.

Here is the caller graph for this function:

Member Data Documentation

◆ height

unsigned Ragot::Window::height
private

Height of the window.

◆ opengl_context

SDL_GLContext Ragot::Window::opengl_context
private

OpenGL context.

◆ width

unsigned Ragot::Window::width
private

Width of the window.

◆ window_handle

SDL_Window* Ragot::Window::window_handle
private

Handle to the SDL window.


The documentation for this class was generated from the following files: