Skip to content

Commit

Permalink
EGL: use eglGetPlatformDisplay if available
Browse files Browse the repository at this point in the history
  • Loading branch information
thesourcehim committed Nov 12, 2024
1 parent 2c7fac5 commit 71c32f4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion desmume/src/frontend/posix/shared/egl_3Demu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ static bool __egl_initOpenGL(const int requestedAPI, const int requestedProfile,

EGLint eglMajorVersion;
EGLint eglMinorVersion;


#ifdef EGL_VERSION_1_5
EGLAttrib attr[] = {EGL_NONE};
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, EGL_DEFAULT_DISPLAY, attr);
if(currDisplay == EGL_NO_DISPLAY)
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_XCB_EXT, EGL_DEFAULT_DISPLAY, attr);
#else
currDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#endif
if(currDisplay == EGL_NO_DISPLAY)
{
puts("EGL: failed to obtain display handle");
return false;
}
if (eglInitialize(currDisplay, &eglMajorVersion, &eglMinorVersion) == EGL_FALSE)
{
puts("EGL: eglInitialize failed");
Expand Down

0 comments on commit 71c32f4

Please sign in to comment.