Skip to content

Commit

Permalink
Native compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Штенгауэр Никита Дмитриевич committed Nov 7, 2023
1 parent aa592d4 commit 54ec6cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion native/src/openglfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ void* a_GetProcAddress(const char* name) {
for(int i = 0; i < 2; i++)
if((libGL = dlopen(NAMES[i], RTLD_NOW | RTLD_GLOBAL)) != NULL)
break;
a_gladGetProcAddress = (glXGetProcAddressPtr)dlsym(libGL, "glXGetProcAddressARB");
}
void* procAddr = (void*)glXGetProcAddressARB((GLubyte*)name);
void* procAddr = (void*)a_gladGetProcAddress((GLubyte*)name);
if(procAddr == NULL)
procAddr = dlsym(libGL, name);
return procAddr;
Expand Down
4 changes: 3 additions & 1 deletion native/src/openglfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ extern wglDXUnlockObjectsNVPtr wglDXUnlockObjectsNV;

#elif defined(__linux__)
#include <dlfcn.h>
#include <GL/glx.h>
static void* libGL;

typedef void* (* glXGetProcAddressPtr)(const char*);
static glXGetProcAddressPtr a_gladGetProcAddress;

#elif defined(__APPLE__)
#include <dlfcn.h>
static void* libGL;
Expand Down

0 comments on commit 54ec6cd

Please sign in to comment.