FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::DeviceCaps Class Reference

#include <devicecaps.h>

+ Collaboration diagram for FIFE::DeviceCaps:

Public Member Functions

 DeviceCaps ()
 Constructor. More...
 
 ~DeviceCaps ()
 Destructor. More...
 
void fillDeviceCaps ()
 Should be called AFTER SDL_Init() has been called. More...
 
void reset ()
 Clears all information gathered for the device. More...
 
std::vector< std::string > getAvailableVideoDrivers () const
 Gets the available video drivers for your operating system. More...
 
std::vector< std::string > getAvailableRenderDrivers () const
 Gets the available render drivers for your operating system. More...
 
std::vector< ScreenModegetSupportedScreenModes () const
 Returns a vector containing screen modes. More...
 
ScreenMode getNearestScreenMode (uint16_t width, uint16_t height, uint16_t bpp, const std::string &renderer, bool fs) const
 Gets the nearest valid screen mode based on the arguments passed. More...
 
ScreenMode getNearestScreenMode (uint16_t width, uint16_t height, uint16_t bpp, const std::string &renderer, bool fs, uint16_t refresh, uint8_t display=0) const
 Gets the nearest valid screen mode based on the arguments passed. More...
 
std::string getVideoDriverName () const
 Returns the name of the current video driver. More...
 
void setVideoDriverName (const std::string &driver)
 Sets the name of the video driver. More...
 
std::string getRenderDriverName () const
 Returns the name of the current render driver or an empty string to initialize the first one supporting the requested flags. More...
 
void setRenderDriverName (const std::string &driver)
 Sets the name of the render driver. More...
 
uint8_t getDisplayCount () const
 Returns the number of displays. More...
 
std::string getDisplayName (uint8_t display=0) const
 Returns the display name for the given display index. More...
 
uint32_t getDesktopFormat (uint8_t display=0) const
 Returns the SDL_PixelFormatEnum of the desktop for the given display index. More...
 
int32_t getDesktopRefreshRate (uint8_t display=0) const
 Returns the refresh rate in Hz of the desktop for the given display index. More...
 
int32_t getDesktopWidth (uint8_t display=0) const
 Returns the width of the desktop resolution for the given display index. More...
 
int32_t getDesktopHeight (uint8_t display=0) const
 Returns the height of the desktop resolution for the given display index. More...
 
Rect getDisplayBounds (uint8_t display=0) const
 Returns the bounding points for the given display index. More...
 

Private Member Functions

void fillAvailableDrivers ()
 Called in the constructor. More...
 

Private Attributes

std::vector< ScreenModem_screenModes
 
std::string m_videoDriverName
 
std::vector< std::string > m_availableVideoDrivers
 
std::string m_renderDriverName
 
int8_t m_renderDriverIndex
 
std::vector< std::string > m_availableRenderDrivers
 

Detailed Description

Definition at line 147 of file devicecaps.h.

Constructor & Destructor Documentation

FIFE::DeviceCaps::DeviceCaps ( )

Constructor.

Definition at line 106 of file devicecaps.cpp.

FIFE::DeviceCaps::~DeviceCaps ( )

Destructor.

Definition at line 112 of file devicecaps.cpp.

Member Function Documentation

void FIFE::DeviceCaps::fillAvailableDrivers ( )
private

Called in the constructor.

No need for anyone to call this

Definition at line 123 of file devicecaps.cpp.

References m_availableRenderDrivers, m_availableVideoDrivers, and m_videoDriverName.

Referenced by fillDeviceCaps(), and reset().

+ Here is the caller graph for this function:

std::vector<std::string> FIFE::DeviceCaps::getAvailableRenderDrivers ( ) const
inline

Gets the available render drivers for your operating system.

Definition at line 171 of file devicecaps.h.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

std::vector<std::string> FIFE::DeviceCaps::getAvailableVideoDrivers ( ) const
inline

Gets the available video drivers for your operating system.

Definition at line 167 of file devicecaps.h.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

uint32_t FIFE::DeviceCaps::getDesktopFormat ( uint8_t  display = 0) const

Returns the SDL_PixelFormatEnum of the desktop for the given display index.

Definition at line 301 of file devicecaps.cpp.

int32_t FIFE::DeviceCaps::getDesktopHeight ( uint8_t  display = 0) const

Returns the height of the desktop resolution for the given display index.

Definition at line 325 of file devicecaps.cpp.

int32_t FIFE::DeviceCaps::getDesktopRefreshRate ( uint8_t  display = 0) const

Returns the refresh rate in Hz of the desktop for the given display index.

Definition at line 309 of file devicecaps.cpp.

int32_t FIFE::DeviceCaps::getDesktopWidth ( uint8_t  display = 0) const

Returns the width of the desktop resolution for the given display index.

Definition at line 317 of file devicecaps.cpp.

Rect FIFE::DeviceCaps::getDisplayBounds ( uint8_t  display = 0) const

Returns the bounding points for the given display index.

Definition at line 333 of file devicecaps.cpp.

uint8_t FIFE::DeviceCaps::getDisplayCount ( ) const

Returns the number of displays.

Definition at line 287 of file devicecaps.cpp.

Referenced by getDisplayName().

+ Here is the caller graph for this function:

std::string FIFE::DeviceCaps::getDisplayName ( uint8_t  display = 0) const

Returns the display name for the given display index.

Definition at line 292 of file devicecaps.cpp.

References getDisplayCount().

ScreenMode FIFE::DeviceCaps::getNearestScreenMode ( uint16_t  width,
uint16_t  height,
uint16_t  bpp,
const std::string &  renderer,
bool  fs 
) const

Gets the nearest valid screen mode based on the arguments passed.

Definition at line 211 of file devicecaps.cpp.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

ScreenMode FIFE::DeviceCaps::getNearestScreenMode ( uint16_t  width,
uint16_t  height,
uint16_t  bpp,
const std::string &  renderer,
bool  fs,
uint16_t  refresh,
uint8_t  display = 0 
) const
std::string FIFE::DeviceCaps::getRenderDriverName ( ) const
inline

Returns the name of the current render driver or an empty string to initialize the first one supporting the requested flags.

Definition at line 196 of file devicecaps.h.

References FIFE::ScreenMode::setRenderDriverName().

std::vector<ScreenMode> FIFE::DeviceCaps::getSupportedScreenModes ( ) const
inline

Returns a vector containing screen modes.

Definition at line 175 of file devicecaps.h.

std::string FIFE::DeviceCaps::getVideoDriverName ( ) const
inline

Returns the name of the current video driver.

Definition at line 187 of file devicecaps.h.

void FIFE::DeviceCaps::reset ( )

Clears all information gathered for the device.

Definition at line 115 of file devicecaps.cpp.

References fillAvailableDrivers(), m_renderDriverIndex, m_renderDriverName, and m_screenModes.

void FIFE::DeviceCaps::setRenderDriverName ( const std::string &  driver)

Sets the name of the render driver.

Definition at line 265 of file devicecaps.cpp.

References fillDeviceCaps(), m_availableRenderDrivers, m_renderDriverIndex, and m_renderDriverName.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::DeviceCaps::setVideoDriverName ( const std::string &  driver)
inline

Sets the name of the video driver.

Definition at line 191 of file devicecaps.h.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<std::string> FIFE::DeviceCaps::m_availableRenderDrivers
private

Definition at line 237 of file devicecaps.h.

Referenced by fillAvailableDrivers(), and setRenderDriverName().

std::vector<std::string> FIFE::DeviceCaps::m_availableVideoDrivers
private

Definition at line 233 of file devicecaps.h.

Referenced by fillAvailableDrivers().

int8_t FIFE::DeviceCaps::m_renderDriverIndex
private

Definition at line 236 of file devicecaps.h.

Referenced by fillDeviceCaps(), getNearestScreenMode(), reset(), and setRenderDriverName().

std::string FIFE::DeviceCaps::m_renderDriverName
private

Definition at line 235 of file devicecaps.h.

Referenced by fillDeviceCaps(), getNearestScreenMode(), reset(), and setRenderDriverName().

std::vector<ScreenMode> FIFE::DeviceCaps::m_screenModes
private

Definition at line 231 of file devicecaps.h.

Referenced by fillDeviceCaps(), and reset().

std::string FIFE::DeviceCaps::m_videoDriverName
private

Definition at line 232 of file devicecaps.h.

Referenced by fillAvailableDrivers().


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