28 #include <SDL_video.h>
41 m_width(0), m_height(0), m_bpp(0), m_SDLFlags(0){
45 m_width(width), m_height(height), m_bpp(bpp), m_SDLFlags(SDLFlags){
91 m_driverName(
"Invalid"),
95 m_hwCCBlitAccel(false),
96 m_hwToHwAlphaBlitAccel(false),
97 m_swToHwBlitAccel(false),
98 m_swToHwCCBlistAccel(false),
99 m_swToHwAlphaBlitAccel(false),
100 m_BlitFillAccel(false),
132 #if defined( __unix__ )
148 #if defined( __APPLE_CC__ )
157 char buffer[bufferSize];
224 for (
uint32_t i = 0; i < numBPP; ++i){
225 for (
uint32_t j = 0; j < numFlags; ++j) {
226 for (
uint32_t k = 0; k < numRes; ++k) {
228 if (flags[j] & SDL_FULLSCREEN) {
229 bpp = SDL_VideoModeOK(resolutions[k][0],resolutions[k][1], bpps[i], flags[j]);
238 bpp = SDL_VideoModeOK(resolutions[k][0],resolutions[k][1], bpps[i], flags[j]);
254 if(SDL_VideoDriverName(buffer, bufferSize) != NULL) {
261 const SDL_VideoInfo* vInfo = SDL_GetVideoInfo();
279 bool foundMode =
false;
281 bool widthCheck =
false;
282 bool heightCheck =
false;
283 bool bppCheck =
false;
284 bool rendCheck =
false;
285 bool fsCheck =
false;
302 if ((
m_screenModes[i].isOpenGL() && (renderer ==
"OpenGL" || renderer ==
"OpenGLe")) || (!
m_screenModes[i].isOpenGL() && renderer ==
"SDL")){
307 if (widthCheck && heightCheck && bppCheck && fsCheck && rendCheck) {
322 if (widthCheck && heightCheck && bpp == 0 && fsCheck && rendCheck) {
343 throw NotSupported(
"Could not find a maching screen mode for the values given!");
static const uint32_t HW_WINDOWED_OPENGL
int32_t getDesktopHeight() const
Returns the height of the desktop resolution.
uint32_t getSDLFlags() const
Returns the SDL flags used when testing this mode.
static const uint32_t FULLSCREEN_SDL_DB_HW
std::vector< std::string > m_availableDrivers
bool m_swToHwCCBlistAccel
uint16_t getBPP() const
Returns the number of bits per pixel this mode uses.
bool operator<(const ScreenMode &rhs) const
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.
void fillAvailableDrivers()
Called in the constructor.
bool isFullScreen() const
True if this is a fullscreen mode.
ScreenMode()
Default Constructor.
static const uint32_t FULLSCREEN_SDL
static const uint32_t HW_FULLSCREEN_OPENGL
void reset()
Clears all information gathered for the device.
uint16_t getHeight() const
Returns the height of the screen mode.
bool m_hwToHwAlphaBlitAccel
uint16_t getWidth() const
Returns the width of the screen mode.
static const uint32_t WINDOWED_SDL_DB_HW
int32_t getDesktopWidth() const
Returns the width of the desktop resolution.
void fillDeviceCaps()
Should be called AFTER SDL_Init() has been called.
static const uint32_t WINDOWED_SDL
std::vector< ScreenMode > m_screenModes
bool m_swToHwAlphaBlitAccel