Add WindowMaximized creation parameter and isWindowMaximized() (#142)

This commit is contained in:
DS
2023-02-06 15:05:44 +01:00
committed by GitHub
parent 8f13ae81e5
commit 51dffc416a
10 changed files with 120 additions and 54 deletions

View File

@ -118,7 +118,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
currentTouchedCount(0),
#endif
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
WindowHasFocus(false), WindowMinimized(false),
WindowHasFocus(false), WindowMinimized(false), WindowMaximized(param.WindowMaximized),
ExternalWindow(false), AutorepeatSupport(0)
{
#ifdef _DEBUG
@ -168,6 +168,9 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
return;
createGUIAndScene();
if (param.WindowMaximized)
maximizeWindow();
}
@ -1200,6 +1203,13 @@ bool CIrrDeviceLinux::isWindowMinimized() const
}
//! returns last state from maximizeWindow() and restoreWindow()
bool CIrrDeviceLinux::isWindowMaximized() const
{
return WindowMaximized;
}
//! returns color format of the window.
video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
{
@ -1284,6 +1294,8 @@ void CIrrDeviceLinux::maximizeWindow()
}
XMapWindow(XDisplay, XWindow);
WindowMaximized = true;
#endif
}
@ -1310,6 +1322,8 @@ void CIrrDeviceLinux::restoreWindow()
}
XMapWindow(XDisplay, XWindow);
WindowMaximized = false;
#endif
}