Commit 83e2ed85 authored by hybrid's avatar hybrid

Separate fullscreen resolution method.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2758 dfc29bdd-3216-0410-991c-e03cc46cb475
parent f7f96520
...@@ -208,31 +208,11 @@ int IrrPrintXError(Display *display, XErrorEvent *event) ...@@ -208,31 +208,11 @@ int IrrPrintXError(Display *display, XErrorEvent *event)
#endif #endif
bool CIrrDeviceLinux::createWindow() bool CIrrDeviceLinux::switchToFullscreen()
{ {
#ifdef _IRR_COMPILE_WITH_X11_ if (!CreationParams.Fullscreen)
#ifdef _DEBUG return true;
os::Printer::log("Creating X window...", ELL_INFORMATION);
XSetErrorHandler(IrrPrintXError);
#endif
display = XOpenDisplay(0);
if (!display)
{
os::Printer::log("Error: Need running XServer to start Irrlicht Engine.", ELL_ERROR);
if (XDisplayName(0)[0])
os::Printer::log("Could not open display", XDisplayName(0), ELL_ERROR);
else
os::Printer::log("Could not open display, set DISPLAY variable", ELL_ERROR);
return false;
}
screennr = DefaultScreen(display);
// query extension
if (CreationParams.Fullscreen)
{
getVideoModeList(); getVideoModeList();
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_) #if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase; s32 eventbase, errorbase;
...@@ -308,8 +288,33 @@ bool CIrrDeviceLinux::createWindow() ...@@ -308,8 +288,33 @@ bool CIrrDeviceLinux::createWindow()
"to switch to fullscreen mode. Running in windowed mode instead.", ELL_WARNING); "to switch to fullscreen mode. Running in windowed mode instead.", ELL_WARNING);
CreationParams.Fullscreen = false; CreationParams.Fullscreen = false;
} }
return CreationParams.Fullscreen;
}
bool CIrrDeviceLinux::createWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
#ifdef _DEBUG
os::Printer::log("Creating X window...", ELL_INFORMATION);
XSetErrorHandler(IrrPrintXError);
#endif
display = XOpenDisplay(0);
if (!display)
{
os::Printer::log("Error: Need running XServer to start Irrlicht Engine.", ELL_ERROR);
if (XDisplayName(0)[0])
os::Printer::log("Could not open display", XDisplayName(0), ELL_ERROR);
else
os::Printer::log("Could not open display, set DISPLAY variable", ELL_ERROR);
return false;
} }
screennr = DefaultScreen(display);
switchToFullscreen();
#ifdef _IRR_COMPILE_WITH_OPENGL_ #ifdef _IRR_COMPILE_WITH_OPENGL_
GLXFBConfig glxFBConfig; GLXFBConfig glxFBConfig;
......
...@@ -135,6 +135,8 @@ namespace irr ...@@ -135,6 +135,8 @@ namespace irr
void initXAtoms(); void initXAtoms();
bool switchToFullscreen();
//! 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