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() ...@@ -150,21 +150,8 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
} }
#endif // #ifdef _IRR_COMPILE_WITH_OPENGL_ #endif // #ifdef _IRR_COMPILE_WITH_OPENGL_
#ifdef _IRR_LINUX_X11_VIDMODE_ // Reset fullscreen resolution change
if (UseXVidMode && CreationParams.Fullscreen) switchToFullscreen(true);
{
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
if (SoftwareImage) if (SoftwareImage)
XDestroyImage(SoftwareImage); XDestroyImage(SoftwareImage);
...@@ -208,10 +195,29 @@ int IrrPrintXError(Display *display, XErrorEvent *event) ...@@ -208,10 +195,29 @@ int IrrPrintXError(Display *display, XErrorEvent *event)
#endif #endif
bool CIrrDeviceLinux::switchToFullscreen() bool CIrrDeviceLinux::switchToFullscreen(bool reset)
{ {
if (!CreationParams.Fullscreen) if (!CreationParams.Fullscreen)
return true; 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(); getVideoModeList();
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_) #if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
......
...@@ -135,7 +135,7 @@ namespace irr ...@@ -135,7 +135,7 @@ namespace irr
void initXAtoms(); void initXAtoms();
bool switchToFullscreen(); bool switchToFullscreen(bool reset=false);
//! Implementation of the linux cursor control //! Implementation of the linux cursor control
class CCursorControl : public gui::ICursorControl 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