From c83eaa654c2aaa0ce74569fcadd53a8892f9750e Mon Sep 17 00:00:00 2001 From: cutealien Date: Sat, 6 Mar 2021 15:49:43 +0000 Subject: [PATCH] SIrrlichtCreationParameters::WindowResizable no longer bool but has 3 states. New default is that the system decides itself. Reason is that X11 didn't like the last change (disabling it on start) too much and we got messed up title-bars. Or at least on some Window Managers. Which makes sense as X11 really requires Windows to be resizable in Windowed mode. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6196 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 2 +- include/SIrrCreationParameters.h | 7 ++++--- source/Irrlicht/CIrrDeviceLinux.cpp | 3 ++- source/Irrlicht/CIrrDeviceSDL.cpp | 2 +- source/Irrlicht/CIrrDeviceWin32.cpp | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/changes.txt b/changes.txt index e6286872..d0d3ef37 100644 --- a/changes.txt +++ b/changes.txt @@ -75,7 +75,7 @@ Changes in 1.9 (not yet released) - Drivers can now try to create textures from images in more exotic color formats (like floating point formats). It depends on the driver how much that works (so far mainly OpenGL can handle it somewhat). - Fix OpenGL to no longer switch colors red and blue in 24-bit RGB format. But warnings added to documentation to avoid 24-bit textures as they are generally just trouble. - No longer try to convert ECF_R5G6B5 to ECF_A1R5G5B5 on OpenGL (just made texture-loading seem to fail). -- Add flag SIrrlichtCreationParameters.WindowResizable. Mainly to work around troubles with SDL+OpenGL on some platforms where resizing later can be tricky/impossible. +- Add parameter SIrrlichtCreationParameters.WindowResizable. Mainly to work around troubles with SDL+OpenGL on some platforms where resizing later can be tricky/impossible. - Add operator[] to vector2d and vector3d - Bugfix: IrrlichtDevice::isWindowMinimized no longer returns true when it's maximized on Windows. - Ignore degenerated faces in obj file loader when they would generate triangles where 2 vertices use identical indices. diff --git a/include/SIrrCreationParameters.h b/include/SIrrCreationParameters.h index ef44e0bc..046a5e44 100644 --- a/include/SIrrCreationParameters.h +++ b/include/SIrrCreationParameters.h @@ -28,7 +28,7 @@ namespace irr Bits(32), ZBufferBits(24), Fullscreen(false), - WindowResizable(false), + WindowResizable(2), Stencilbuffer(true), Vsync(false), AntiAlias(0), @@ -121,8 +121,9 @@ namespace irr //! Should a non-fullscreen window be resizable. /** Might not be supported by all devices. Ignored when Fullscreen is true. - Default: false */ - bool WindowResizable; + Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself + Default: 2*/ + u8 WindowResizable; //! Specifies if the stencil buffer should be enabled. /** Set this to true, if you want the engine be able to draw diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp index 2d587e55..630078aa 100644 --- a/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/source/Irrlicht/CIrrDeviceLinux.cpp @@ -133,7 +133,8 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param) // create the window, only if we do not use the null device if (!createWindow()) return; - setResizable(param.WindowResizable); + if (param.WindowResizable < 2 ) + setResizable(param.WindowResizable == 1 ? true : false); } // create cursor control diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 45c1330f..beddc132 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -53,7 +53,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_ANYFORMAT), MouseX(0), MouseY(0), MouseButtonStates(0), Width(param.WindowSize.Width), Height(param.WindowSize.Height), - Resizable(param.WindowResizable), WindowMinimized(false) + Resizable(param.WindowResizable > 0 ? true : false), WindowMinimized(false) { #ifdef _DEBUG setDebugName("CIrrDeviceSDL"); diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index 966451a4..2afec41b 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -1037,7 +1037,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) clientSize.right = CreationParams.WindowSize.Width; clientSize.bottom = CreationParams.WindowSize.Height; - DWORD style = getWindowStyle(CreationParams.Fullscreen, CreationParams.WindowResizable); + DWORD style = getWindowStyle(CreationParams.Fullscreen, CreationParams.WindowResizable > 0 ? true : false); AdjustWindowRect(&clientSize, style, FALSE); const s32 realWidth = clientSize.right - clientSize.left; @@ -1285,7 +1285,7 @@ DWORD CIrrDeviceWin32::getWindowStyle(bool fullscreen, bool resizable) const return WS_THICKFRAME | WS_SYSMENU | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; return WS_BORDER | WS_SYSMENU | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; -} +} //! sets the caption of the window void CIrrDeviceWin32::setWindowCaption(const wchar_t* text) @@ -1658,7 +1658,7 @@ void CIrrDeviceWin32::getWindowsVersion(core::stringc& out) (LPBYTE) szProductType, &dwBufLen); RegCloseKey( hKey ); - + if (irr::core::stringc("WINNT").equals_ignore_case(szProductType)) out.append("Professional "); if (irr::core::stringc("LANMANNT").equals_ignore_case(szProductType))