Skip to content

Commit

Permalink
Don't use ifdef, just try every method to obtain display handle, rename
Browse files Browse the repository at this point in the history
attr variable
  • Loading branch information
thesourcehim committed Nov 13, 2024
1 parent 71c32f4 commit b1efbef
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions desmume/src/frontend/posix/shared/egl_3Demu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ 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);
EGLAttrib displayAttr[] = {EGL_NONE};
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, EGL_DEFAULT_DISPLAY, displayAttr);
if(currDisplay == EGL_NO_DISPLAY)
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_XCB_EXT, EGL_DEFAULT_DISPLAY, attr);
#else
currDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#endif
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_XCB_EXT, EGL_DEFAULT_DISPLAY, displayAttr);
if(currDisplay == EGL_NO_DISPLAY)
currDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if(currDisplay == EGL_NO_DISPLAY)
{
puts("EGL: failed to obtain display handle");
Expand Down

0 comments on commit b1efbef

Please sign in to comment.