FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <devicecaps.h>
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< ScreenMode > | getSupportedScreenModes () 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< ScreenMode > | m_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 |
Definition at line 147 of file devicecaps.h.
FIFE::DeviceCaps::DeviceCaps | ( | ) |
Constructor.
Definition at line 106 of file devicecaps.cpp.
FIFE::DeviceCaps::~DeviceCaps | ( | ) |
Destructor.
Definition at line 112 of file devicecaps.cpp.
|
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().
void FIFE::DeviceCaps::fillDeviceCaps | ( | ) |
Should be called AFTER SDL_Init() has been called.
Definition at line 144 of file devicecaps.cpp.
References fillAvailableDrivers(), FIFE::ScreenMode::FULLSCREEN_OPENGL, FIFE::ScreenMode::FULLSCREEN_SDL, m_renderDriverIndex, m_renderDriverName, m_screenModes, FIFE::ScreenMode::setDisplay(), FIFE::ScreenMode::setFormat(), FIFE::ScreenMode::setRenderDriverIndex(), FIFE::ScreenMode::setRenderDriverName(), FIFE::ScreenMode::WINDOWED_OPENGL, and FIFE::ScreenMode::WINDOWED_SDL.
Referenced by FIFE::Engine::init(), and setRenderDriverName().
|
inline |
Gets the available render drivers for your operating system.
Definition at line 171 of file devicecaps.h.
Referenced by FIFE::Engine::init().
|
inline |
Gets the available video drivers for your operating system.
Definition at line 167 of file devicecaps.h.
Referenced by FIFE::Engine::init().
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().
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().
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 |
Gets the nearest valid screen mode based on the arguments passed.
Definition at line 216 of file devicecaps.cpp.
References m_renderDriverIndex, m_renderDriverName, FIFE::ScreenMode::setDisplay(), FIFE::ScreenMode::setFormat(), FIFE::ScreenMode::setRenderDriverIndex(), and FIFE::ScreenMode::setRenderDriverName().
|
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().
|
inline |
Returns a vector containing screen modes.
Definition at line 175 of file devicecaps.h.
|
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().
|
inline |
Sets the name of the video driver.
Definition at line 191 of file devicecaps.h.
Referenced by FIFE::Engine::init().
|
private |
Definition at line 237 of file devicecaps.h.
Referenced by fillAvailableDrivers(), and setRenderDriverName().
|
private |
Definition at line 233 of file devicecaps.h.
Referenced by fillAvailableDrivers().
|
private |
Definition at line 236 of file devicecaps.h.
Referenced by fillDeviceCaps(), getNearestScreenMode(), reset(), and setRenderDriverName().
|
private |
Definition at line 235 of file devicecaps.h.
Referenced by fillDeviceCaps(), getNearestScreenMode(), reset(), and setRenderDriverName().
|
private |
Definition at line 231 of file devicecaps.h.
Referenced by fillDeviceCaps(), and reset().
|
private |
Definition at line 232 of file devicecaps.h.
Referenced by fillAvailableDrivers().