FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::ScreenMode Class Reference

#include <devicecaps.h>

+ Collaboration diagram for FIFE::ScreenMode:

Public Member Functions

 ScreenMode ()
 Default Constructor. More...
 
 ScreenMode (uint16_t width, uint16_t height, uint16_t bpp, uint32_t SDLFlags)
 
 ScreenMode (uint16_t width, uint16_t height, uint16_t bpp, uint16_t rate, uint32_t SDLFlags)
 
 ScreenMode (const ScreenMode &rhs)
 
 ~ScreenMode ()
 Destructor. More...
 
bool operator< (const ScreenMode &rhs) const
 
uint16_t getWidth () const
 Returns the width of the screen mode. More...
 
uint16_t getHeight () const
 Returns the height of the screen mode. More...
 
uint16_t getBPP () const
 Returns the number of bits per pixel this mode uses. More...
 
uint16_t getRefreshRate () const
 Returns the refresh rate in Hz of this mode. More...
 
uint32_t getSDLFlags () const
 Returns the SDL flags used when testing this mode. More...
 
bool isFullScreen () const
 True if this is a fullscreen mode. More...
 
bool isOpenGL () const
 True if this mode uses the OpenGL renderer. More...
 
bool isSDL () const
 Is this screen mode an SDL only screen mode. More...
 
void setFormat (uint32_t format)
 Sets the pixel format enum. More...
 
uint32_t getFormat () const
 Returns the pixel format enum. More...
 
void setDisplay (uint8_t display)
 Sets the display index. More...
 
uint8_t getDisplay () const
 Returns the display index. More...
 
void setRenderDriverName (const std::string driver)
 Sets the render driver name. More...
 
const std::string & getRenderDriverName () const
 Returns the render driver name. More...
 
void setRenderDriverIndex (int8_t index)
 Sets the index of the render driver used by SDL. More...
 
int8_t getRenderDriverIndex () const
 Returns the index of the render driver. More...
 

Static Public Attributes

static const uint32_t WINDOWED_OPENGL = SDL_WINDOW_OPENGL
 
static const uint32_t FULLSCREEN_OPENGL = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN
 
static const uint32_t WINDOWED_SDL = 0
 
static const uint32_t FULLSCREEN_SDL = SDL_WINDOW_FULLSCREEN
 

Private Attributes

uint16_t m_width
 
uint16_t m_height
 
uint16_t m_bpp
 
uint16_t m_refreshRate
 
uint32_t m_SDLFlags
 
uint32_t m_format
 
uint8_t m_display
 
std::string m_renderDriver
 
int8_t m_renderDriverIndex
 

Detailed Description

Definition at line 41 of file devicecaps.h.

Constructor & Destructor Documentation

◆ ScreenMode() [1/4]

FIFE::ScreenMode::ScreenMode ( )

Default Constructor.

Note
You shouldn't construct these objects yourself. This default constructor was provided because swig complained that was none.

Definition at line 40 of file devicecaps.cpp.

◆ ScreenMode() [2/4]

FIFE::ScreenMode::ScreenMode ( uint16_t  width,
uint16_t  height,
uint16_t  bpp,
uint32_t  SDLFlags 
)

Definition at line 45 of file devicecaps.cpp.

◆ ScreenMode() [3/4]

FIFE::ScreenMode::ScreenMode ( uint16_t  width,
uint16_t  height,
uint16_t  bpp,
uint16_t  rate,
uint32_t  SDLFlags 
)

Definition at line 50 of file devicecaps.cpp.

◆ ScreenMode() [4/4]

◆ ~ScreenMode()

FIFE::ScreenMode::~ScreenMode ( )
inline

Destructor.

Definition at line 54 of file devicecaps.h.

References operator<().

Member Function Documentation

◆ getBPP()

uint16_t FIFE::ScreenMode::getBPP ( ) const
inline

Returns the number of bits per pixel this mode uses.

Definition at line 72 of file devicecaps.h.

References m_bpp.

Referenced by operator<(), ScreenMode(), FIFE::RenderBackendOpenGL::setScreenMode(), and FIFE::RenderBackendSDL::setScreenMode().

+ Here is the caller graph for this function:

◆ getDisplay()

uint8_t FIFE::ScreenMode::getDisplay ( ) const
inline

Returns the display index.

Definition at line 108 of file devicecaps.h.

References m_display.

Referenced by operator<(), ScreenMode(), FIFE::RenderBackendOpenGL::setScreenMode(), and FIFE::RenderBackendSDL::setScreenMode().

+ Here is the caller graph for this function:

◆ getFormat()

uint32_t FIFE::ScreenMode::getFormat ( ) const
inline

Returns the pixel format enum.

Definition at line 100 of file devicecaps.h.

References m_format.

Referenced by ScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().

+ Here is the caller graph for this function:

◆ getHeight()

uint16_t FIFE::ScreenMode::getHeight ( ) const
inline

Returns the height of the screen mode.

Note
If both width and height are 0 it means that ALL modes are available for use with the specified flags. Most likely this is a windowed mode.

Definition at line 68 of file devicecaps.h.

References m_height.

Referenced by FIFE::Engine::changeScreenMode(), operator<(), ScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().

+ Here is the caller graph for this function:

◆ getRefreshRate()

uint16_t FIFE::ScreenMode::getRefreshRate ( ) const
inline

Returns the refresh rate in Hz of this mode.

Definition at line 76 of file devicecaps.h.

References m_refreshRate.

Referenced by operator<(), ScreenMode(), FIFE::RenderBackendOpenGL::setScreenMode(), and FIFE::RenderBackendSDL::setScreenMode().

+ Here is the caller graph for this function:

◆ getRenderDriverIndex()

int8_t FIFE::ScreenMode::getRenderDriverIndex ( ) const
inline

Returns the index of the render driver.

Default is -1.

Definition at line 124 of file devicecaps.h.

References m_renderDriverIndex.

Referenced by ScreenMode(), and FIFE::RenderBackendSDL::setScreenMode().

+ Here is the caller graph for this function:

◆ getRenderDriverName()

const std::string& FIFE::ScreenMode::getRenderDriverName ( ) const
inline

Returns the render driver name.

Default is "".

Definition at line 116 of file devicecaps.h.

References m_renderDriver.

Referenced by ScreenMode().

+ Here is the caller graph for this function:

◆ getSDLFlags()

uint32_t FIFE::ScreenMode::getSDLFlags ( ) const
inline

Returns the SDL flags used when testing this mode.

Definition at line 80 of file devicecaps.h.

References m_SDLFlags.

Referenced by ScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().

+ Here is the caller graph for this function:

◆ getWidth()

uint16_t FIFE::ScreenMode::getWidth ( ) const
inline

Returns the width of the screen mode.

Note
If both width and height are 0 it means that ALL modes are available for use with the specified flags. Most likely this is a windowed mode.

Definition at line 62 of file devicecaps.h.

References m_width.

Referenced by FIFE::Engine::changeScreenMode(), operator<(), ScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().

+ Here is the caller graph for this function:

◆ isFullScreen()

bool FIFE::ScreenMode::isFullScreen ( ) const
inline

True if this is a fullscreen mode.

False if it is a windowed mode.

Definition at line 84 of file devicecaps.h.

References m_SDLFlags.

Referenced by operator<(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().

+ Here is the caller graph for this function:

◆ isOpenGL()

bool FIFE::ScreenMode::isOpenGL ( ) const
inline

True if this mode uses the OpenGL renderer.

False otherwise.

Definition at line 88 of file devicecaps.h.

References m_SDLFlags.

◆ isSDL()

bool FIFE::ScreenMode::isSDL ( ) const
inline

Is this screen mode an SDL only screen mode.

Definition at line 92 of file devicecaps.h.

References m_SDLFlags.

◆ operator<()

bool FIFE::ScreenMode::operator< ( const ScreenMode rhs) const

Definition at line 67 of file devicecaps.cpp.

References getBPP(), getDisplay(), getHeight(), getRefreshRate(), getWidth(), isFullScreen(), m_bpp, m_display, m_height, m_refreshRate, and m_width.

Referenced by ~ScreenMode().

+ Here is the caller graph for this function:

◆ setDisplay()

void FIFE::ScreenMode::setDisplay ( uint8_t  display)
inline

Sets the display index.

Definition at line 104 of file devicecaps.h.

References m_display.

Referenced by FIFE::DeviceCaps::fillDeviceCaps(), and FIFE::DeviceCaps::getNearestScreenMode().

+ Here is the caller graph for this function:

◆ setFormat()

void FIFE::ScreenMode::setFormat ( uint32_t  format)
inline

Sets the pixel format enum.

Definition at line 96 of file devicecaps.h.

References m_format.

Referenced by FIFE::DeviceCaps::fillDeviceCaps(), and FIFE::DeviceCaps::getNearestScreenMode().

+ Here is the caller graph for this function:

◆ setRenderDriverIndex()

void FIFE::ScreenMode::setRenderDriverIndex ( int8_t  index)
inline

Sets the index of the render driver used by SDL.

Definition at line 120 of file devicecaps.h.

References m_renderDriverIndex.

Referenced by FIFE::DeviceCaps::fillDeviceCaps(), and FIFE::DeviceCaps::getNearestScreenMode().

+ Here is the caller graph for this function:

◆ setRenderDriverName()

void FIFE::ScreenMode::setRenderDriverName ( const std::string  driver)
inline

Sets the render driver name.

Definition at line 112 of file devicecaps.h.

References m_renderDriver.

Referenced by FIFE::DeviceCaps::fillDeviceCaps(), FIFE::DeviceCaps::getNearestScreenMode(), and FIFE::DeviceCaps::getRenderDriverName().

+ Here is the caller graph for this function:

Member Data Documentation

◆ FULLSCREEN_OPENGL

const uint32_t FIFE::ScreenMode::FULLSCREEN_OPENGL = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN
static

Definition at line 129 of file devicecaps.h.

Referenced by FIFE::DeviceCaps::fillDeviceCaps().

◆ FULLSCREEN_SDL

const uint32_t FIFE::ScreenMode::FULLSCREEN_SDL = SDL_WINDOW_FULLSCREEN
static

Definition at line 133 of file devicecaps.h.

Referenced by FIFE::DeviceCaps::fillDeviceCaps().

◆ m_bpp

uint16_t FIFE::ScreenMode::m_bpp
private

Definition at line 138 of file devicecaps.h.

Referenced by getBPP(), operator<(), and ScreenMode().

◆ m_display

uint8_t FIFE::ScreenMode::m_display
private

Definition at line 142 of file devicecaps.h.

Referenced by getDisplay(), operator<(), ScreenMode(), and setDisplay().

◆ m_format

uint32_t FIFE::ScreenMode::m_format
private

Definition at line 141 of file devicecaps.h.

Referenced by getFormat(), ScreenMode(), and setFormat().

◆ m_height

uint16_t FIFE::ScreenMode::m_height
private

Definition at line 137 of file devicecaps.h.

Referenced by getHeight(), operator<(), and ScreenMode().

◆ m_refreshRate

uint16_t FIFE::ScreenMode::m_refreshRate
private

Definition at line 139 of file devicecaps.h.

Referenced by getRefreshRate(), operator<(), and ScreenMode().

◆ m_renderDriver

std::string FIFE::ScreenMode::m_renderDriver
private

Definition at line 143 of file devicecaps.h.

Referenced by getRenderDriverName(), ScreenMode(), and setRenderDriverName().

◆ m_renderDriverIndex

int8_t FIFE::ScreenMode::m_renderDriverIndex
private

Definition at line 144 of file devicecaps.h.

Referenced by getRenderDriverIndex(), ScreenMode(), and setRenderDriverIndex().

◆ m_SDLFlags

uint32_t FIFE::ScreenMode::m_SDLFlags
private

Definition at line 140 of file devicecaps.h.

Referenced by getSDLFlags(), isFullScreen(), isOpenGL(), isSDL(), and ScreenMode().

◆ m_width

uint16_t FIFE::ScreenMode::m_width
private

Definition at line 136 of file devicecaps.h.

Referenced by getWidth(), operator<(), and ScreenMode().

◆ WINDOWED_OPENGL

const uint32_t FIFE::ScreenMode::WINDOWED_OPENGL = SDL_WINDOW_OPENGL
static

Definition at line 127 of file devicecaps.h.

Referenced by FIFE::DeviceCaps::fillDeviceCaps().

◆ WINDOWED_SDL

const uint32_t FIFE::ScreenMode::WINDOWED_SDL = 0
static

Definition at line 131 of file devicecaps.h.

Referenced by FIFE::DeviceCaps::fillDeviceCaps().


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