support Fullscreen with Win32 API

This commit is contained in:
Thomas Bernard
2018-06-21 22:48:07 +02:00
parent 48ee0c06d2
commit 486a0a09d4
2 changed files with 57 additions and 6 deletions

View File

@@ -2081,8 +2081,7 @@ void Set_all_video_modes(void)
// Note that we voluntarily omit the first entry: the default mode.
qsort(&Video_mode[1], Nb_video_modes - 1, sizeof(T_Video_mode), Compare_video_modes);
}
#endif
#if defined(USE_SDL2)
#elif defined(USE_SDL2)
{
SDL_DisplayMode dm;
if (SDL_GetDesktopDisplayMode(0, &dm) == 0)
@@ -2091,6 +2090,20 @@ void Set_all_video_modes(void)
Set_video_mode(dm.w, dm.h, 0, 1);
}
}
#elif defined(WIN32)
{
int width = GetSystemMetrics(SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
if (width > 0 && height > 0)
{
Video_mode[Nb_video_modes].Width = width;
Video_mode[Nb_video_modes].Height = height;
Video_mode[Nb_video_modes].Mode = 0;
Video_mode[Nb_video_modes].Fullscreen = 1;
Video_mode[Nb_video_modes].State = 1;
Nb_video_modes ++;
}
}
#endif
}