Revert "SDL: Move detection of the desktop resolution into the SdlWindow class"
This commit is contained in:
parent
d195f77c40
commit
b5d73d4c22
6 changed files with 55 additions and 35 deletions
|
@ -194,6 +194,7 @@ void OSystem_SDL::initBackend() {
|
|||
debug(1, "Using SDL Video Driver \"%s\"", sdlDriverName);
|
||||
|
||||
// ResidualVM specific code start
|
||||
detectDesktopResolution();
|
||||
#ifdef USE_OPENGL
|
||||
detectFramebufferSupport();
|
||||
detectAntiAliasingSupport();
|
||||
|
@ -255,6 +256,24 @@ void OSystem_SDL::initBackend() {
|
|||
}
|
||||
|
||||
// ResidualVM specific code
|
||||
void OSystem_SDL::detectDesktopResolution() {
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_DisplayMode displayMode;
|
||||
if (!SDL_GetDesktopDisplayMode(0, &displayMode)) {
|
||||
_capabilities.desktopWidth = displayMode.w;
|
||||
_capabilities.desktopHeight = displayMode.h;
|
||||
}
|
||||
#else
|
||||
// Query the desktop resolution. We simply hope nothing tried to change
|
||||
// the resolution so far.
|
||||
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
|
||||
if (videoInfo && videoInfo->current_w > 0 && videoInfo->current_h > 0) {
|
||||
_capabilities.desktopWidth = videoInfo->current_w;
|
||||
_capabilities.desktopHeight = videoInfo->current_h;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
void OSystem_SDL::detectFramebufferSupport() {
|
||||
_capabilities.openGLFrameBuffer = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue