Skip to content

Commit

Permalink
Update to load "libGL.so" instead of "libGL.so.1"
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Nov 9, 2023
1 parent 4082c7f commit 33659b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions template/gl3w.h
Expand Up @@ -18,7 +18,7 @@
// WILL NOT BE USING OUR LOADER, AND INSTEAD EXPECT ANOTHER/YOUR LOADER TO BE AVAILABLE IN THE COMPILATION UNIT.
//
// Regenerate with:
// python gl3w_gen.py --output ../imgui/backends/imgui_impl_opengl3_loader.h --ref ../imgui/backends/imgui_impl_opengl3.cpp ./extra_symbols.txt
// python3 gl3w_gen.py --output ../imgui/backends/imgui_impl_opengl3_loader.h --ref ../imgui/backends/imgui_impl_opengl3.cpp ./extra_symbols.txt
//
// More info:
// https://github.com/dearimgui/gl3w_stripped
Expand Down Expand Up @@ -189,7 +189,8 @@ static GL3WglProc (*glx_get_proc_address)(const GLubyte *);

static int open_libgl(void)
{
libgl = dlopen("libGL.so.1", RTLD_LAZY | RTLD_LOCAL);
// While most systems use libGL.so.1, NetBSD seems to use that libGL.so.3. See https://github.com/ocornut/imgui/issues/6983
libgl = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
if (!libgl)
return GL3W_ERROR_LIBRARY_OPEN;
*(void **)(&glx_get_proc_address) = dlsym(libgl, "glXGetProcAddressARB");
Expand Down

0 comments on commit 33659b8

Please sign in to comment.