mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-10 06:02:10 +08:00
engine: platform: sdl2: get maximized state in VID_SaveWindowMode
This commit is contained in:
@@ -417,14 +417,7 @@ static void SDLash_EventHandler( SDL_Event *event )
|
||||
SDLash_ActiveEvent( false );
|
||||
break;
|
||||
case SDL_WINDOWEVENT_RESIZED:
|
||||
#if !XASH_MOBILE_PLATFORM
|
||||
if( vid_fullscreen.value == WINDOW_MODE_WINDOWED )
|
||||
#endif
|
||||
{
|
||||
SDL_Window *wnd = SDL_GetWindowFromID( event->window.windowID );
|
||||
VID_SaveWindowSize( event->window.data1, event->window.data2,
|
||||
FBitSet( SDL_GetWindowFlags( wnd ), SDL_WINDOW_MAXIMIZED ) != 0 );
|
||||
}
|
||||
VID_SaveWindowSize( event->window.data1, event->window.data2 );
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||
Cvar_DirectSet( &vid_maximized, "1" );
|
||||
|
||||
@@ -25,7 +25,7 @@ void VID_RestoreScreenResolution( window_mode_t window_mode );
|
||||
qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode );
|
||||
void VID_DestroyWindow( void );
|
||||
void GL_InitExtensions( void );
|
||||
void VID_SaveWindowSize( int width, int height, qboolean maximized );
|
||||
void VID_SaveWindowSize( int width, int height );
|
||||
|
||||
//
|
||||
// in_sdl.c
|
||||
|
||||
@@ -389,8 +389,9 @@ static qboolean GL_DeleteContext( void )
|
||||
return false;
|
||||
}
|
||||
|
||||
void VID_SaveWindowSize( int width, int height, qboolean maximized )
|
||||
void VID_SaveWindowSize( int width, int height )
|
||||
{
|
||||
qboolean maximized = FBitSet( SDL_GetWindowFlags( host.hWnd ), SDL_WINDOW_MAXIMIZED );
|
||||
int render_w = width, render_h = height;
|
||||
|
||||
#if SDL_VERSION_ATLEAST( 2, 26, 0 )
|
||||
@@ -523,7 +524,7 @@ static qboolean VID_SetScreenResolution( int width, int height, window_mode_t wi
|
||||
window_mode == WINDOW_MODE_BORDERLESS ? "borderless" :
|
||||
window_mode == WINDOW_MODE_FULLSCREEN ? "fullscreen" : "windowed" );
|
||||
|
||||
VID_SaveWindowSize( out_width, out_height, FBitSet( SDL_GetWindowFlags( host.hWnd ), SDL_WINDOW_MAXIMIZED ) != 0 );
|
||||
VID_SaveWindowSize( out_width, out_height );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -788,7 +789,7 @@ qboolean VID_CreateWindow( int input_width, int input_height, window_mode_t wind
|
||||
|
||||
// update window size if it was resized
|
||||
SDL_GetWindowSize( host.hWnd, &rect.w, &rect.h );
|
||||
VID_SaveWindowSize( rect.w, rect.h, FBitSet( SDL_GetWindowFlags( host.hWnd ), SDL_WINDOW_MAXIMIZED ));
|
||||
VID_SaveWindowSize( rect.w, rect.h );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user