FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
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

◆ DeviceCaps()

FIFE::DeviceCaps::DeviceCaps ( )

Constructor.

Definition at line 106 of file devicecaps.cpp.

◆ ~DeviceCaps()

FIFE::DeviceCaps::~DeviceCaps ( )

Destructor.

Definition at line 112 of file devicecaps.cpp.

Member Function Documentation

◆ fillAvailableDrivers()

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:

◆ fillDeviceCaps()

◆ getAvailableRenderDrivers()

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:

◆ getAvailableVideoDrivers()

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:

◆ getDesktopFormat()

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.

◆ getDesktopHeight()

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.

◆ getDesktopRefreshRate()

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.

◆ getDesktopWidth()

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.

◆ getDisplayBounds()

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.

◆ getDisplayCount()

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:

◆ getDisplayName()

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().

◆ getNearestScreenMode() [1/2]

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:

◆ getNearestScreenMode() [2/2]

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

◆ getRenderDriverName()

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().

◆ getSupportedScreenModes()

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

Returns a vector containing screen modes.

Definition at line 175 of file devicecaps.h.

◆ getVideoDriverName()

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

Returns the name of the current video driver.

Definition at line 187 of file devicecaps.h.

◆ reset()

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.

◆ setRenderDriverName()

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:

◆ setVideoDriverName()

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

◆ m_availableRenderDrivers

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

Definition at line 237 of file devicecaps.h.

Referenced by fillAvailableDrivers(), and setRenderDriverName().

◆ m_availableVideoDrivers

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

Definition at line 233 of file devicecaps.h.

Referenced by fillAvailableDrivers().

◆ m_renderDriverIndex

int8_t FIFE::DeviceCaps::m_renderDriverIndex
private

Definition at line 236 of file devicecaps.h.

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

◆ m_renderDriverName

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

Definition at line 235 of file devicecaps.h.

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

◆ m_screenModes

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

Definition at line 231 of file devicecaps.h.

Referenced by fillDeviceCaps(), and reset().

◆ m_videoDriverName

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: