ge211  2021.5.1
A student game engine
Window Class Reference

Detailed Description

Provides access to the game window and its properties.

Definition at line 16 of file ge211_window.hxx.

+ Collaboration diagram for Window:

Public Member Functions

Dims< int > get_dimensions () const
 Returns the current dimensions of this window.
 
void set_dimensions (Dims< int >)
 Changes the size of the window. More...
 
Posn< int > get_position () const
 Gets the position of the upper-left corner of the window with respect to the upper-left corner of the screen.
 
void set_position (Posn< int >)
 Sets the position of the upper-left corner of the window with respect to the upper-left corner of the screen.
 
bool get_fullscreen () const
 Returns whether the program is in fullscreen mode.
 
void set_fullscreen (bool)
 Sets whether the program should be in fullscreen mode. More...
 
Dims< int > max_window_dimensions () const
 Returns the maximum dimensions for a non-fullscreen window. More...
 

Static Public Member Functions

static Dims< int > max_fullscreen_dimensions ()
 Returns the maximum dimensions for a fullscreen window. More...
 

Static Public Attributes

static const Posn< int > centered {SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED}
 A special value to pass to set_position(Posn<int>) to center the window on the screen.
 

Member Function Documentation

◆ max_fullscreen_dimensions()

Dims< int > max_fullscreen_dimensions ( )
static

Returns the maximum dimensions for a fullscreen window.

Call this before switching to fullscreen mode, since if you fullscreen a smaller window, the video mode may change.

Definition at line 81 of file ge211_window.cxx.

◆ max_window_dimensions()

Dims< int > max_window_dimensions ( ) const

Returns the maximum dimensions for a non-fullscreen window.

This is the size of the screen, minus space reserved for the system (such as the Windows taskbar or Mac menu and dock).

Definition at line 88 of file ge211_window.cxx.

◆ set_dimensions()

void set_dimensions ( Dims< int >  dims)

Changes the size of the window.

Throws exceptions::Environment_error if the dimensions are negative or outside the allowable range.

Definition at line 34 of file ge211_window.cxx.

◆ set_fullscreen()

void set_fullscreen ( bool  fullscreen)

Sets whether the program should be in fullscreen mode.

Throws exceptions::Host_error if change fails.

Definition at line 73 of file ge211_window.cxx.


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