Browse Source

SDL1: Support fullscreen

This "just works" now, not sure which of the commits fixed it.
pull/362/head
Gleb Mazovetskiy 7 years ago committed by Anders Jenbo
parent
commit
9d4dce5c62
  1. 7
      SourceX/miniwin/misc.cpp

7
SourceX/miniwin/misc.cpp

@ -137,15 +137,14 @@ bool SpawnWindow(LPCSTR lpWindowName, int nWidth, int nHeight)
#ifdef USE_SDL1 #ifdef USE_SDL1
int flags = SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE; int flags = SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE;
if (fullscreen) { if (fullscreen)
SDL_Log("fullscreen not yet supported with SDL1"); flags |= SDL_FULLSCREEN;
}
// flags |= fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE;
SDL_WM_SetCaption(lpWindowName, WINDOW_ICON_NAME); SDL_WM_SetCaption(lpWindowName, WINDOW_ICON_NAME);
SDL_SetVideoMode(nWidth, nHeight, /*bpp=*/0, flags); SDL_SetVideoMode(nWidth, nHeight, /*bpp=*/0, flags);
window = SDL_GetVideoSurface(); window = SDL_GetVideoSurface();
if (grabInput) if (grabInput)
SDL_WM_GrabInput(SDL_GRAB_ON); SDL_WM_GrabInput(SDL_GRAB_ON);
atexit(SDL_VideoQuit); // Without this video mode is not restored after fullscreen.
#else #else
int flags = 0; int flags = 0;
if (upscale) { if (upscale) {

Loading…
Cancel
Save