diff options
author | sfan5 <sfan5@live.de> | 2021-03-12 17:47:00 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-03-12 17:47:00 +0100 |
commit | 57ff34b1edb3e477b811ddf1165aa360a2e3eda6 (patch) | |
tree | 06b8ad048f4a66ede88e129879d9fe4c9bb1f54b /source/Irrlicht/CGLXManager.cpp | |
parent | 0335a52479b6bd654482ca9d559433aa95b0e00a (diff) | |
download | irrlicht-57ff34b1edb3e477b811ddf1165aa360a2e3eda6.tar.xz |
CGLXManager: Use GLX window correctly
fixes #17
Diffstat (limited to 'source/Irrlicht/CGLXManager.cpp')
-rw-r--r-- | source/Irrlicht/CGLXManager.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/Irrlicht/CGLXManager.cpp b/source/Irrlicht/CGLXManager.cpp index 4778a49..b98e0b0 100644 --- a/source/Irrlicht/CGLXManager.cpp +++ b/source/Irrlicht/CGLXManager.cpp @@ -296,6 +296,10 @@ bool CGLXManager::generateSurface() 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;
}
|