Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
inexor::rendering::screen::ScreenManager Class Reference

The screen manager manages the SDL window. More...

#include <ScreenManager.hpp>

Public Member Functions

 ScreenManager ()
 The default constructor. More...
 
virtual ~ScreenManager ()
 The default destructor. More...
 
void screenres (int w, int h)
 Changes the screen resolution. More...
 
void setfullscreen (bool enable)
 Switch to fullscreen or windowed mode. More...
 
void setupscreen (int &useddepthbits, int &usedfsaa)
 Setting up screen using various attempts with different options. More...
 
void restoregamma ()
 Set screen gamma using float value. More...
 
void cleargamma ()
 Set screen to normal gamma. More...
 
void restorevsync ()
 "use this function to set the swap interval for the current OpenGL context" (VSYNC) More...
 
void cleanupSDL ()
 Clean up SDL. More...
 
void swapbuffers (bool overlay=true)
 swapping buffers allows to render to a new buffer while the other is being presented to the screen More...
 
void set_minimized (bool minimized)
 
bool is_minimized ()
 

Public Attributes

int screenw
 screen resolution management More...
 
int screenh
 
int desktopw
 
int desktoph
 
bool minimized
 If true, the window is minimized. More...
 
bool initwindowpos
 
int curgamma
 
SDL_Window * sdl_window
 Simple DirectMedia Window and Layer. More...
 
SDL_GLContext glcontext = nullptr
 

Detailed Description

The screen manager manages the SDL window.

Constructor & Destructor Documentation

inexor::rendering::screen::ScreenManager::ScreenManager ( )

The default constructor.

inexor::rendering::screen::ScreenManager::~ScreenManager ( )
virtual

The default destructor.

Member Function Documentation

void inexor::rendering::screen::ScreenManager::cleanupSDL ( )

Clean up SDL.

References cleargamma(), and sdl_window.

Referenced by cleanup(), and cleanup_application().

void inexor::rendering::screen::ScreenManager::cleargamma ( )

Set screen to normal gamma.

"Use this function to set the brightness (gamma multiplier) for the display that owns a given window."

References curgamma, f(), and sdl_window.

Referenced by cleanupSDL().

bool inexor::rendering::screen::ScreenManager::is_minimized ( )

References minimized.

void inexor::rendering::screen::ScreenManager::restoregamma ( )

Set screen gamma using float value.

See Also
curgamma

References curgamma, f(), and sdl_window.

Referenced by resetgl().

void inexor::rendering::screen::ScreenManager::restorevsync ( )

"use this function to set the swap interval for the current OpenGL context" (VSYNC)

https://wiki.libsdl.org/SDL_GL_SetSwapInterval

References glcontext, inexor::rendering::screen::vsync, and inexor::rendering::screen::vsynctear.

Referenced by setupscreen().

void inexor::rendering::screen::ScreenManager::screenres ( int  w,
int  h 
)
void inexor::rendering::screen::ScreenManager::set_minimized ( bool  minimized)
void inexor::rendering::screen::ScreenManager::setfullscreen ( bool  enable)
void inexor::rendering::screen::ScreenManager::setupscreen ( int &  useddepthbits,
int &  usedfsaa 
)
void inexor::rendering::screen::ScreenManager::swapbuffers ( bool  overlay = true)

swapping buffers allows to render to a new buffer while the other is being presented to the screen

See Also
SDL_GL_SwapWindow

References recorder::capture(), gle::disable(), and sdl_window.

Referenced by main(), renderbackground(), and renderprogress().

Member Data Documentation

int inexor::rendering::screen::ScreenManager::curgamma

Referenced by cleargamma(), and restoregamma().

int inexor::rendering::screen::ScreenManager::desktoph

Referenced by screenres(), and setupscreen().

int inexor::rendering::screen::ScreenManager::desktopw

Referenced by screenres(), and setupscreen().

SDL_GLContext inexor::rendering::screen::ScreenManager::glcontext = nullptr

Referenced by restorevsync(), and setupscreen().

bool inexor::rendering::screen::ScreenManager::initwindowpos

Referenced by setfullscreen(), and setupscreen().

bool inexor::rendering::screen::ScreenManager::minimized
int inexor::rendering::screen::ScreenManager::screenh
int inexor::rendering::screen::ScreenManager::screenw
SDL_Window* inexor::rendering::screen::ScreenManager::sdl_window

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