Commit 3a29e0bb authored by hybrid's avatar hybrid

Merge fullscreen resolution reset into new method.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2759 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 83e2ed85
......@@ -150,21 +150,8 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
}
#endif // #ifdef _IRR_COMPILE_WITH_OPENGL_
#ifdef _IRR_LINUX_X11_VIDMODE_
if (UseXVidMode && CreationParams.Fullscreen)
{
XF86VidModeSwitchToMode(display, screennr, &oldVideoMode);
XF86VidModeSetViewPort(display, screennr, 0, 0);
}
#endif
#ifdef _IRR_LINUX_X11_RANDR_
if (UseXRandR && CreationParams.Fullscreen)
{
XRRScreenConfiguration *config=XRRGetScreenInfo(display,DefaultRootWindow(display));
XRRSetScreenConfig(display,config,DefaultRootWindow(display),oldRandrMode,oldRandrRotation,CurrentTime);
XRRFreeScreenConfigInfo(config);
}
#endif
// Reset fullscreen resolution change
switchToFullscreen(true);
if (SoftwareImage)
XDestroyImage(SoftwareImage);
......@@ -208,10 +195,29 @@ int IrrPrintXError(Display *display, XErrorEvent *event)
#endif
bool CIrrDeviceLinux::switchToFullscreen()
bool CIrrDeviceLinux::switchToFullscreen(bool reset)
{
if (!CreationParams.Fullscreen)
return true;
if (reset)
{
#ifdef _IRR_LINUX_X11_VIDMODE_
if (UseXVidMode && CreationParams.Fullscreen)
{
XF86VidModeSwitchToMode(display, screennr, &oldVideoMode);
XF86VidModeSetViewPort(display, screennr, 0, 0);
}
#endif
#ifdef _IRR_LINUX_X11_RANDR_
if (UseXRandR && CreationParams.Fullscreen)
{
XRRScreenConfiguration *config=XRRGetScreenInfo(display,DefaultRootWindow(display));
XRRSetScreenConfig(display,config,DefaultRootWindow(display),oldRandrMode,oldRandrRotation,CurrentTime);
XRRFreeScreenConfigInfo(config);
}
#endif
return true;
}
getVideoModeList();
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
......
......@@ -135,7 +135,7 @@ namespace irr
void initXAtoms();
bool switchToFullscreen();
bool switchToFullscreen(bool reset=false);
//! Implementation of the linux cursor control
class CCursorControl : public gui::ICursorControl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment