Merge pull request #931 from JoseJX/16Bit

OPENGL: Add another 16 bit mode.
This commit is contained in:
Paweł Kołodziejski 2014-09-09 17:25:19 +02:00
commit 93aaaf5a88

View File

@ -224,6 +224,24 @@ Graphics::PixelBuffer SurfaceSdlGraphicsManager::setupScreen(uint screenW, uint
setAntialiasing(false);
_screen = SDL_SetVideoMode(screenW, screenH, 0, sdlflags);
}
// If 16-bit with alpha failed, try 16-bit without alpha
if (!_screen && _opengl) {
warning("Couldn't create 16-bit visual with alpha, trying without alpha");
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
setAntialiasing(true);
_screen = SDL_SetVideoMode(screenW, screenH, 0, sdlflags);
}
// If 16-bit without alpha and with antialiasing didn't work, try without antialiasing
if (!_screen && _opengl && _antialiasing) {
warning("Couldn't create 16-bit visual with AA, trying 16-bit without AA");
setAntialiasing(false);
_screen = SDL_SetVideoMode(screenW, screenH, 0, sdlflags);
}
#endif
if (!_screen) {