Linux: fix uiGLGetProcAddress()

This commit is contained in:
StapleButter 2019-06-01 00:27:54 +02:00
parent 3e760a2e34
commit b9529e8361
2 changed files with 10 additions and 5 deletions

View File

@ -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()

View File

@ -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 = glXGetProcAddressARB((const GLubyte*)proc);
ptr = eglGetProcAddress(proc);
if (ptr) return ptr;
ptr = dlsym(NULL /* RTLD_DEFAULT */, proc);
if (ptr) return ptr;
return NULL;