aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 17:41:10 +1000
committerDavid Walter Seikel2013-01-13 17:41:10 +1000
commit8772dabfcdf0d7ade826f213b7ae887615e7ee3f (patch)
tree9258e6a4f76127577cf958e05211732f8973ac4f /libraries/irrlicht-1.8/source
parentIgnore Irrlicht built files. (diff)
downloadSledjHamr-8772dabfcdf0d7ade826f213b7ae887615e7ee3f.zip
SledjHamr-8772dabfcdf0d7ade826f213b7ae887615e7ee3f.tar.gz
SledjHamr-8772dabfcdf0d7ade826f213b7ae887615e7ee3f.tar.bz2
SledjHamr-8772dabfcdf0d7ade826f213b7ae887615e7ee3f.tar.xz
Let Irrlicht use an externally created OpenGL context and surface.
Linux only for now. Others can come later.
Diffstat (limited to 'libraries/irrlicht-1.8/source')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CIrrDeviceLinux.cpp17
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)