Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
Window Class Reference

The Window class encapsulates an SDL window used for rendering the game. It handles window creation, access to window dimensions, and cleanup. More...

#include <Window.h>

Public Member Functions

 Window (int pWidth, int pHeight, std::string pTitle)
 Constructs a Window with specified width, height, and title.
 
 Window (const Window &)=delete
 
Windowoperator= (const Window &)=delete
 
Vector2 GetDimensions () const
 Gets the dimensions of the window.
 
SDL_Window * GetSdlWindow () const
 Gets the raw SDL_Window pointer.
 
bool Open ()
 Initializes the SDL video subsystem and creates the window.
 
void Update ()
 Updates the window per frame (currently unused).
 
void Close ()
 Closes and destroys the SDL window.
 

Detailed Description

The Window class encapsulates an SDL window used for rendering the game. It handles window creation, access to window dimensions, and cleanup.

Constructor & Destructor Documentation

◆ Window() [1/2]

Window::Window ( int pWidth,
int pHeight,
std::string pTitle )

Constructs a Window with specified width, height, and title.

Parameters
pWidthWidth of the window in pixels.
pHeightHeight of the window in pixels.
pTitleTitle text for the window.

◆ Window() [2/2]

Window::Window ( const Window & )
delete

Member Function Documentation

◆ Close()

void Window::Close ( )

Closes and destroys the SDL window.

◆ GetDimensions()

Vector2 Window::GetDimensions ( ) const

Gets the dimensions of the window.

Returns
A Vector2 representing the window's width and height.

◆ GetSdlWindow()

SDL_Window * Window::GetSdlWindow ( ) const

Gets the raw SDL_Window pointer.

Returns
Pointer to the internal SDL_Window.

◆ Open()

bool Window::Open ( )

Initializes the SDL video subsystem and creates the window.

Returns
True if the window was created successfully, false otherwise.

◆ operator=()

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

◆ Update()

void Window::Update ( )

Updates the window per frame (currently unused).


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