diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp b/libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp index f9d2d00..6339b6a 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp | |||
@@ -375,7 +375,10 @@ bool CIrrDeviceLinux::createWindow() | |||
375 | XSetErrorHandler(IrrPrintXError); | 375 | XSetErrorHandler(IrrPrintXError); |
376 | #endif | 376 | #endif |
377 | 377 | ||
378 | display = XOpenDisplay(0); | 378 | if (CreationParams.VideoData) |
379 | display = (Display *) CreationParams.VideoData->OpenGLLinux.X11Display; | ||
380 | if (!display) | ||
381 | display = XOpenDisplay(0); | ||
379 | if (!display) | 382 | if (!display) |
380 | { | 383 | { |
381 | os::Printer::log("Error: Need running XServer to start Irrlicht Engine.", ELL_ERROR); | 384 | os::Printer::log("Error: Need running XServer to start Irrlicht Engine.", ELL_ERROR); |
@@ -719,7 +722,17 @@ bool CIrrDeviceLinux::createWindow() | |||
719 | Context=0; | 722 | Context=0; |
720 | if (isAvailableGLX && CreationParams.DriverType==video::EDT_OPENGL) | 723 | if (isAvailableGLX && CreationParams.DriverType==video::EDT_OPENGL) |
721 | { | 724 | { |
722 | if (UseGLXWindow) | 725 | if (CreationParams.VideoData) |
726 | Context = (GLXContext) CreationParams.VideoData->OpenGLLinux.X11Context; | ||
727 | if (Context) | ||
728 | { | ||
729 | if (!glXMakeCurrent(display, window, Context)) | ||
730 | { | ||
731 | os::Printer::log("Could not make context current.", ELL_WARNING); | ||
732 | glXDestroyContext(display, Context); | ||
733 | } | ||
734 | } | ||
735 | else if (UseGLXWindow) | ||
723 | { | 736 | { |
724 | glxWin=glXCreateWindow(display,glxFBConfig,window,NULL); | 737 | glxWin=glXCreateWindow(display,glxFBConfig,window,NULL); |
725 | if (glxWin) | 738 | if (glxWin) |