mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Window resizing only with X11 (not on Windows and Mac OS X)
This commit is contained in:
parent
0667864657
commit
1446adee2c
|
@ -223,10 +223,12 @@ int CInput::Update()
|
||||||
// shortcuts
|
// shortcuts
|
||||||
switch (Event.window.event)
|
switch (Event.window.event)
|
||||||
{
|
{
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||||
case SDL_WINDOWEVENT_RESIZED:
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||||
Graphics()->Resize(Event.window.data1, Event.window.data2);
|
Graphics()->Resize(Event.window.data1, Event.window.data2);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
// TODO: Check if from FOCUS_LOST til FOCUS_GAINED is good enough, maybe also ENTER and LEAVE
|
// TODO: Check if from FOCUS_LOST til FOCUS_GAINED is good enough, maybe also ENTER and LEAVE
|
||||||
|
|
|
@ -102,7 +102,11 @@ MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIE
|
||||||
MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)")
|
MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)")
|
||||||
//MACRO_CONFIG_INT(GfxClear, gfx_clear, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering")
|
//MACRO_CONFIG_INT(GfxClear, gfx_clear, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering")
|
||||||
MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync")
|
MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync")
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||||
MACRO_CONFIG_INT(GfxResizable, gfx_resizable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enables window resizing")
|
MACRO_CONFIG_INT(GfxResizable, gfx_resizable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enables window resizing")
|
||||||
|
#else
|
||||||
|
MACRO_CONFIG_INT(GfxResizable, gfx_resizable, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enables window resizing")
|
||||||
|
#endif
|
||||||
MACRO_CONFIG_INT(GfxDisplayAllModes, gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
MACRO_CONFIG_INT(GfxDisplayAllModes, gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||||
MACRO_CONFIG_INT(GfxTextureCompression, gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression")
|
MACRO_CONFIG_INT(GfxTextureCompression, gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression")
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
|
|
|
@ -850,7 +850,11 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
g_Config.m_GfxColorDepth = Depth;
|
g_Config.m_GfxColorDepth = Depth;
|
||||||
g_Config.m_GfxScreenWidth = s_aModes[NewSelected].m_Width;
|
g_Config.m_GfxScreenWidth = s_aModes[NewSelected].m_Width;
|
||||||
g_Config.m_GfxScreenHeight = s_aModes[NewSelected].m_Height;
|
g_Config.m_GfxScreenHeight = s_aModes[NewSelected].m_Height;
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||||
Graphics()->Resize(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight);
|
Graphics()->Resize(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight);
|
||||||
|
#else
|
||||||
|
CheckSettings = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// switches
|
// switches
|
||||||
|
|
Loading…
Reference in a new issue