Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CVideoMode Class Reference

#include <VideoMode.h>

Public Member Functions

 CVideoMode ()
 
bool InitSDL ()
 Initialise the video mode, for use in an SDL-using application. More...
 
bool InitNonSDL ()
 Initialise parts of the video mode, for use in Atlas (which uses wxWidgets instead of SDL for GL). More...
 
void Shutdown ()
 Shut down after InitSDL/InitNonSDL, so that they can be used again. More...
 
bool ResizeWindow (int w, int h)
 Resize the SDL window and associated graphics stuff to the new size. More...
 
bool SetFullscreen (bool fullscreen)
 Switch to fullscreen or windowed mode. More...
 
bool ToggleFullscreen ()
 Switch between fullscreen and windowed mode. More...
 
void UpdatePosition (int x, int y)
 Update window position, to restore later if necessary (SDL2 only). More...
 
int GetXRes ()
 
int GetYRes ()
 
int GetBPP ()
 
int GetDesktopXRes ()
 
int GetDesktopYRes ()
 
int GetDesktopBPP ()
 
int GetDesktopFreq ()
 
SDL_WindowGetWindow ()
 

Static Public Member Functions

static void UpdateRenderer (int w, int h)
 Update the graphics code to start drawing to the new size. More...
 

Private Member Functions

void ReadConfig ()
 
int GetBestBPP ()
 
bool SetVideoMode (int w, int h, int bpp, bool fullscreen)
 
void EnableS3TC ()
 

Private Attributes

bool m_IsInitialised
 Remember whether Init has been called. More...
 
SDL_Windowm_Window
 
int m_PreferredW
 
int m_PreferredH
 
int m_PreferredBPP
 
int m_PreferredFreq
 
int m_ConfigW
 
int m_ConfigH
 
int m_ConfigBPP
 
int m_ConfigDisplay
 
bool m_ConfigFullscreen
 
bool m_ConfigForceS3TCEnable
 
int m_WindowedW
 
int m_WindowedH
 
int m_WindowedX
 
int m_WindowedY
 
bool m_IsFullscreen
 
int m_CurrentW
 
int m_CurrentH
 
int m_CurrentBPP
 

Constructor & Destructor Documentation

CVideoMode::CVideoMode ( )

Member Function Documentation

void CVideoMode::EnableS3TC ( )
private
int CVideoMode::GetBestBPP ( )
private
int CVideoMode::GetBPP ( )
int CVideoMode::GetDesktopBPP ( )
int CVideoMode::GetDesktopFreq ( )
int CVideoMode::GetDesktopXRes ( )
int CVideoMode::GetDesktopYRes ( )
SDL_Window * CVideoMode::GetWindow ( )
int CVideoMode::GetXRes ( )
int CVideoMode::GetYRes ( )
bool CVideoMode::InitNonSDL ( )

Initialise parts of the video mode, for use in Atlas (which uses wxWidgets instead of SDL for GL).

Currently this just tries to enable S3TC.

bool CVideoMode::InitSDL ( )

Initialise the video mode, for use in an SDL-using application.

void CVideoMode::ReadConfig ( )
private
bool CVideoMode::ResizeWindow ( int  w,
int  h 
)

Resize the SDL window and associated graphics stuff to the new size.

bool CVideoMode::SetFullscreen ( bool  fullscreen)

Switch to fullscreen or windowed mode.

bool CVideoMode::SetVideoMode ( int  w,
int  h,
int  bpp,
bool  fullscreen 
)
private
void CVideoMode::Shutdown ( void  )

Shut down after InitSDL/InitNonSDL, so that they can be used again.

bool CVideoMode::ToggleFullscreen ( )

Switch between fullscreen and windowed mode.

void CVideoMode::UpdatePosition ( int  x,
int  y 
)

Update window position, to restore later if necessary (SDL2 only).

void CVideoMode::UpdateRenderer ( int  w,
int  h 
)
static

Update the graphics code to start drawing to the new size.

This should be called after the GL context has been resized. This can also be used when the GL context is managed externally, not via SDL.

Member Data Documentation

int CVideoMode::m_ConfigBPP
private
int CVideoMode::m_ConfigDisplay
private
bool CVideoMode::m_ConfigForceS3TCEnable
private
bool CVideoMode::m_ConfigFullscreen
private
int CVideoMode::m_ConfigH
private
int CVideoMode::m_ConfigW
private
int CVideoMode::m_CurrentBPP
private
int CVideoMode::m_CurrentH
private
int CVideoMode::m_CurrentW
private
bool CVideoMode::m_IsFullscreen
private
bool CVideoMode::m_IsInitialised
private

Remember whether Init has been called.

(This isn't used for anything important, just for verifying that the callers call our methods in the right order.)

int CVideoMode::m_PreferredBPP
private
int CVideoMode::m_PreferredFreq
private
int CVideoMode::m_PreferredH
private
int CVideoMode::m_PreferredW
private
SDL_Window* CVideoMode::m_Window
private
int CVideoMode::m_WindowedH
private
int CVideoMode::m_WindowedW
private
int CVideoMode::m_WindowedX
private
int CVideoMode::m_WindowedY
private

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