aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2019-06-01 00:27:54 +0200
committerStapleButter <thetotalworm@gmail.com>2019-06-01 00:27:54 +0200
commitb9529e83619f1e2b725ea86508b546d72e072a0c (patch)
treee2b7f6a0b4dd67003d5e1c4082420c6ab17ccbf0
parent3e760a2e34990e9f0e416550091783a7d6695e60 (diff)
Linux: fix uiGLGetProcAddress()
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/libui_sdl/libui/unix/gl.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d096c02..a1110f1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -29,5 +29,5 @@ add_library(core STATIC
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32 opengl32)
else()
- target_link_libraries(core GL)
+ target_link_libraries(core GL EGL)
endif()
diff --git a/src/libui_sdl/libui/unix/gl.c b/src/libui_sdl/libui/unix/gl.c
index 6965969..4a180ef 100644
--- a/src/libui_sdl/libui/unix/gl.c
+++ b/src/libui_sdl/libui/unix/gl.c
@@ -2,8 +2,8 @@
#include "uipriv_unix.h"
#include <GL/gl.h>
-
-void* glXGetProcAddressARB(const GLubyte* name);
+#include <GL/glx.h>
+#include <EGL/egl.h>
extern GThread* gtkthread;
extern GMutex glmutex;
@@ -220,10 +220,15 @@ void *uiGLGetProcAddress(const char* proc)
{
// TODO: consider using epoxy or something funny
- void* ptr = dlsym(NULL /* RTLD_DEFAULT */, proc);
+ void* ptr;
+
+ ptr = glXGetProcAddressARB((const GLubyte*)proc);
+ if (ptr) return ptr;
+
+ ptr = eglGetProcAddress(proc);
if (ptr) return ptr;
- ptr = glXGetProcAddressARB((const GLubyte*)proc);
+ ptr = dlsym(NULL /* RTLD_DEFAULT */, proc);
if (ptr) return ptr;
return NULL;