diff --git a/desmume/src/frontend/posix/codeblocks/desmume.cbp b/desmume/src/frontend/posix/codeblocks/desmume.cbp index 120d59b08..5e7a0e255 100644 --- a/desmume/src/frontend/posix/codeblocks/desmume.cbp +++ b/desmume/src/frontend/posix/codeblocks/desmume.cbp @@ -24,7 +24,6 @@ - @@ -72,7 +71,6 @@ - diff --git a/desmume/src/frontend/posix/configure.ac b/desmume/src/frontend/posix/configure.ac index 89b886618..d4d201014 100644 --- a/desmume/src/frontend/posix/configure.ac +++ b/desmume/src/frontend/posix/configure.ac @@ -126,18 +126,12 @@ if test "x$glx" = "xyes" ; then AC_CHECK_HEADERS([GL/glx.h], [have_glx=yes], [have_glx=no]) if test "have_glx" = "no" ; then AC_MSG_WARN([Cannot use GLX -- headers not found.]) - else - AC_CHECK_LIB(dl, main) - AC_CHECK_LIB(GL, main) - AC_CHECK_LIB(GLX, main) fi fi if test "$have_glx" = "yes" ; then if test "$have_opengl" = "yes" ; then AC_DEFINE(ENABLE_GLX) - GLX_LIBS="-lGLX" - AC_SUBST(GLX_LIBS) else have_glx=no if test "$have_opengles" = "yes" ; then diff --git a/desmume/src/frontend/posix/gtk/Makefile.am b/desmume/src/frontend/posix/gtk/Makefile.am index c4952a715..63a1d7b08 100644 --- a/desmume/src/frontend/posix/gtk/Makefile.am +++ b/desmume/src/frontend/posix/gtk/Makefile.am @@ -36,7 +36,6 @@ endif endif if ENABLE_GLX -desmume_LDADD += $(GLX_LIBS) desmume_SOURCES += ../shared/glx_3Demu.h ../shared/glx_3Demu.cpp else if ENABLE_OSMESA diff --git a/desmume/src/frontend/posix/gtk/meson.build b/desmume/src/frontend/posix/gtk/meson.build index 42c3c797b..53f4b3883 100644 --- a/desmume/src/frontend/posix/gtk/meson.build +++ b/desmume/src/frontend/posix/gtk/meson.build @@ -24,7 +24,7 @@ desmume_src = [ gresource, ] -if get_option('glx') and dep_glx.found() +if get_option('glx') and dep_gl.found() desmume_src += [ '../shared/glx_3Demu.cpp', ] diff --git a/desmume/src/frontend/posix/gtk2/Makefile.am b/desmume/src/frontend/posix/gtk2/Makefile.am index 1f155dc45..7554f5b52 100644 --- a/desmume/src/frontend/posix/gtk2/Makefile.am +++ b/desmume/src/frontend/posix/gtk2/Makefile.am @@ -36,7 +36,6 @@ endif endif if ENABLE_GLX -desmume_LDADD += $(GLX_LIBS) desmume_SOURCES += ../shared/glx_3Demu.h ../shared/glx_3Demu.cpp else if ENABLE_OSMESA diff --git a/desmume/src/frontend/posix/gtk2/meson.build b/desmume/src/frontend/posix/gtk2/meson.build index e0d4fb01c..ffa9285fb 100644 --- a/desmume/src/frontend/posix/gtk2/meson.build +++ b/desmume/src/frontend/posix/gtk2/meson.build @@ -17,7 +17,7 @@ desmume_src = [ 'main.cpp', ] -if get_option('glx') and dep_glx.found() +if get_option('glx') and dep_gl.found() desmume_src += [ '../shared/glx_3Demu.cpp', ] diff --git a/desmume/src/frontend/posix/meson.build b/desmume/src/frontend/posix/meson.build index 3280842b4..77e6f62c2 100644 --- a/desmume/src/frontend/posix/meson.build +++ b/desmume/src/frontend/posix/meson.build @@ -22,7 +22,6 @@ dep_alsa = dependency('alsa', required: false) dep_soundtouch = dependency('soundtouch', required: false) dep_agg = dependency('libagg', required: false) dep_fontconfig = dependency('fontconfig', required: false) -dep_glx = dependency('glx', required: false) dep_osmesa = dependency('osmesa', required: false) dep_egl = dependency('egl', required: false) @@ -198,17 +197,16 @@ elif get_option('opengl') endif if get_option('glx') - if dep_glx.found() - if get_option('opengl') and dep_gl.found() + if dep_gl.found() + if get_option('opengl') add_global_arguments('-DENABLE_GLX', language: ['c', 'cpp']) - dependencies += dep_glx elif get_option('opengles') message('GLX contexts are incompatible with OpenGL ES -- cancelling the use of GLX.') else message('GLX contexts are only compatible with standard OpenGL -- cancelling the use of GLX.') endif else - message('Cannot use GLX -- glx library not found.') + message('Cannot use GLX -- gl library not found.') endif elif get_option('osmesa') if dep_osmesa.found() diff --git a/desmume/src/frontend/posix/shared/glx_3Demu.cpp b/desmume/src/frontend/posix/shared/glx_3Demu.cpp index 80e872d47..9288d1f22 100644 --- a/desmume/src/frontend/posix/shared/glx_3Demu.cpp +++ b/desmume/src/frontend/posix/shared/glx_3Demu.cpp @@ -86,7 +86,7 @@ static bool __glx_initOpenGL(const int requestedProfile, const int requestedVers const char *extensionSet = glXQueryExtensionsString(currDisplay, currScreen); const char *foundString = strstr(extensionSet, "GLX_ARB_create_context_profile"); - glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB"); + glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress( (const GLubyte *) "glXCreateContextAttribsARB"); if ( (foundString == NULL) || (glXCreateContextAttribsARB == NULL) ) { @@ -273,7 +273,7 @@ bool glx_beginOpenGL() prevReadDrawable = glXGetCurrentReadDrawable(); prevContext = glXGetCurrentContext(); - if (pendingDrawable != NULL) + if (pendingDrawable != 0) { bool previousIsCurrent = (prevDrawDrawable == currDrawable);