Skip to content

Commit

Permalink
GLSupport: EGL - fix multi-window operation
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 7, 2023
1 parent 52bfb31 commit b8089b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions RenderSystems/GLSupport/src/EGL/OgreEGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ namespace Ogre {

void EGLContext::setCurrent()
{
if(eglGetCurrentSurface(EGL_DRAW) == mDrawable)
return;

EGLBoolean ret = eglMakeCurrent(mEglDisplay,
mDrawable, mDrawable, mContext);
EGL_CHECK_ERROR
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/GLSupport/src/EGL/OgreEGLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace Ogre {
{
return;
}

mContext->setCurrent();
if (eglSwapBuffers(mEglDisplay, mEglSurface) == EGL_FALSE)
{
EGL_CHECK_ERROR
Expand Down
9 changes: 1 addition & 8 deletions RenderSystems/GLSupport/src/EGL/X11/OgreX11EGLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ namespace Ogre {
"EGLWindow::create");
}

mEglSurface = eglGetCurrentSurface(EGL_DRAW);
EGL_CHECK_ERROR
mEglDisplay = eglGetCurrentDisplay();
EGL_CHECK_ERROR
}
Expand Down Expand Up @@ -339,8 +337,6 @@ namespace Ogre {
}
}

mIsExternal = (mEglSurface != 0);

if (!mEglConfig)
{
int minAttribs[] = {
Expand Down Expand Up @@ -381,10 +377,7 @@ namespace Ogre {
mGLSupport->switchMode (width, height, frequency);
}

if (!mIsExternal)
{
createNativeWindow(left, top, width, height, title);
}
createNativeWindow(left, top, width, height, title);

mContext = createEGLContext(eglContext);

Expand Down

0 comments on commit b8089b6

Please sign in to comment.