- update for video fallback if current resolution fails
This commit is contained in:
parent
8325463c71
commit
3866cf286f
|
@ -114,13 +114,15 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugError).enabled) SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,msg.str().c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugError).enabled) SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,msg.str().c_str());
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,msg.str().c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,msg.str().c_str());
|
||||||
|
|
||||||
// try to revert to 800x600
|
for(int i = 32; i >= 8; i-=8) {
|
||||||
screen = SDL_SetVideoMode(800, 600, 16, flags);
|
// try to revert to 800x600
|
||||||
if(screen == 0) {
|
screen = SDL_SetVideoMode(800, 600, i, flags);
|
||||||
// try to revert to 640x480
|
|
||||||
screen = SDL_SetVideoMode(640, 480, 8, flags);
|
|
||||||
if(screen == 0) {
|
if(screen == 0) {
|
||||||
throw std::runtime_error(msg.str());
|
// try to revert to 640x480
|
||||||
|
screen = SDL_SetVideoMode(640, 480, i, flags);
|
||||||
|
if(screen == 0) {
|
||||||
|
throw std::runtime_error(msg.str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//throw std::runtime_error(msg.str());
|
//throw std::runtime_error(msg.str());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user