]> git.cworth.org Git - apitrace/blobdiff - glws_egl_xlib.cpp
Cleanup glproc.
[apitrace] / glws_egl_xlib.cpp
index 958e951b4ef6526cd1bdf6943e4eb3a8f5b7fe45..eb284ab031ea198053ffb384f29089657146e671 100644 (file)
 
 #include <iostream>
 
-#include "glws.hpp"
+#include <dlfcn.h>
 
 #include "glproc.hpp"
+#include "glws.hpp"
 
 
 namespace glws {
@@ -229,6 +230,13 @@ init(void) {
 
     screen = DefaultScreen(display);
 
+    __libGlHandle = dlopen("libEGL.so", RTLD_GLOBAL | RTLD_LAZY);
+    if (!__libGlHandle) {
+        std::cerr << "error: unable to open libEGL.so\n";
+        XCloseDisplay(display);
+        exit(1);
+    }
+
     eglDisplay = eglGetDisplay(display);
     if (eglDisplay == EGL_NO_DISPLAY) {
         std::cerr << "error: unable to get EGL display\n";