wxWidgets/SDL2 port now supports setting custom screen resolution. Patch from bit.
This commit is contained in:
parent
0c63c99b71
commit
807ee15f49
6 changed files with 9553 additions and 9228 deletions
|
|
@ -39,6 +39,9 @@ SDL_Rect remembered_rect;
|
|||
int remembered_mouse_x = 0;
|
||||
int remembered_mouse_y = 0;
|
||||
|
||||
int custom_resolution_width = 640;
|
||||
int custom_resolution_height = 480;
|
||||
|
||||
int win_doresize = 0;
|
||||
int winsizex = 640, winsizey = 480;
|
||||
|
||||
|
|
@ -304,6 +307,12 @@ void window_setup()
|
|||
rect.w = 640;
|
||||
rect.h = 480;
|
||||
}
|
||||
|
||||
if (vid_resize == 2)
|
||||
{
|
||||
rect.w = custom_resolution_width;
|
||||
rect.h = custom_resolution_height;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
|
@ -374,7 +383,7 @@ int window_create()
|
|||
{
|
||||
window = SDL_CreateWindow("PCem Display",
|
||||
rect.x, rect.y, rect.w, rect.h,
|
||||
requested_render_driver.sdl_window_params | (vid_resize ? SDL_WINDOW_RESIZABLE : 0));
|
||||
requested_render_driver.sdl_window_params | (vid_resize == 1 ? SDL_WINDOW_RESIZABLE : 0));
|
||||
if (!window)
|
||||
{
|
||||
char message[200];
|
||||
|
|
@ -427,11 +436,13 @@ int render()
|
|||
window_dosetresize = 0;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 5)
|
||||
SDL_GetWindowSize(window, &rect.w, &rect.h);
|
||||
SDL_SetWindowResizable(window, vid_resize);
|
||||
SDL_SetWindowResizable(window, vid_resize == 1);
|
||||
SDL_SetWindowSize(window, rect.w, rect.h);
|
||||
#else
|
||||
window_doreset = 1;
|
||||
#endif
|
||||
if (vid_resize == 2)
|
||||
SDL_SetWindowSize(window, custom_resolution_width, custom_resolution_height);
|
||||
}
|
||||
if (window_doreset)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue