Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Wayland initialization #3154

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

benjaminvdh
Copy link
Contributor

There are some problems with Wayland initialization:

  • An assertion fails, and the list of EGL extensions contains all client extensions twice and none of the display extensions, because WaylandEGLSupport::start() is called when mGLDisplay has not yet been set.
  • GLNativeSupport::mFSAAlevels is duplicated every time a WaylandEGLWindow is created, because of the WaylandEGLSupport::doInit() call in WaylandEGLWindow::create().
  • The wl_surface is stored in WaylandEGLSupport, but each WaylandEGLWindow should be able to have its own wl_surface.

I changed WaylandEGLSupport::start() to only print a message, and delayed the EGL initialization to the first time WaylandEGLSupport::newWindow() is called. This is similar to the way Win32GLSupport handles initialization.

I also fixed some minor errors I found when setting ENABLE_EGL_CHECK to 1 for testing purposes: eglTerminate could be called with a null mGLDisplay if more than one render system was loaded, causing an EGL_BAD_DISPLAY error, and trying to create an unsupported EGL context triggered an exception.

@paroj
Copy link
Member

paroj commented Jul 8, 2024

thanks

@paroj paroj merged commit a1eb371 into OGRECave:master Jul 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants