diff --git a/include/SExposedVideoData.h b/include/SExposedVideoData.h index d4b2cfd2..c1ddc03b 100644 --- a/include/SExposedVideoData.h +++ b/include/SExposedVideoData.h @@ -61,6 +61,7 @@ struct SExposedVideoData void* X11Display; void* X11Context; unsigned long X11Window; + unsigned long GLXWindow; }; struct SOpenGLOSX diff --git a/source/Irrlicht/CGLXManager.cpp b/source/Irrlicht/CGLXManager.cpp index dd1c28ba..22ae5776 100644 --- a/source/Irrlicht/CGLXManager.cpp +++ b/source/Irrlicht/CGLXManager.cpp @@ -294,7 +294,11 @@ bool CGLXManager::generateSurface() return false; } - CurrentContext.OpenGLLinux.X11Window=GlxWin; + CurrentContext.OpenGLLinux.GLXWindow=GlxWin; + } + else + { + CurrentContext.OpenGLLinux.GLXWindow=CurrentContext.OpenGLLinux.X11Window; } return true; } @@ -353,13 +357,14 @@ bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool resto { if (videoData.OpenGLLinux.X11Display && videoData.OpenGLLinux.X11Context) { - if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)videoData.OpenGLLinux.X11Context)) + if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.GLXWindow, (GLXContext)videoData.OpenGLLinux.X11Context)) { os::Printer::log("Context activation failed."); return false; } else { + CurrentContext.OpenGLLinux.GLXWindow = videoData.OpenGLLinux.GLXWindow; CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window; CurrentContext.OpenGLLinux.X11Display = videoData.OpenGLLinux.X11Display; } @@ -367,13 +372,14 @@ bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool resto else { // in case we only got a window ID, try with the existing values for display and context - if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)PrimaryContext.OpenGLLinux.X11Context)) + if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.GLXWindow, (GLXContext)PrimaryContext.OpenGLLinux.X11Context)) { os::Printer::log("Context activation failed."); return false; } else { + CurrentContext.OpenGLLinux.GLXWindow = videoData.OpenGLLinux.GLXWindow; CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window; CurrentContext.OpenGLLinux.X11Display = PrimaryContext.OpenGLLinux.X11Display; } @@ -425,7 +431,7 @@ void CGLXManager::destroyContext() bool CGLXManager::swapBuffers() { - glXSwapBuffers((Display*)CurrentContext.OpenGLLinux.X11Display, CurrentContext.OpenGLLinux.X11Window); + glXSwapBuffers((Display*)CurrentContext.OpenGLLinux.X11Display, CurrentContext.OpenGLLinux.GLXWindow); return true; } diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 60d5a963..281666ac 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ -Tests finished. 72 tests of 72 passed. -Compiled as RELEASE -Test suite pass at GMT Sat Apr 30 22:54:30 2022 - +Tests finished. 72 tests of 72 passed. +Compiled as DEBUG +Test suite pass at GMT Mon May 2 16:15:12 2022 +