summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/x11/detect_prime_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/x11/detect_prime_x11.cpp')
-rw-r--r--platform/linuxbsd/x11/detect_prime_x11.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/platform/linuxbsd/x11/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp
index ed046432d8..0f756d10e2 100644
--- a/platform/linuxbsd/x11/detect_prime_x11.cpp
+++ b/platform/linuxbsd/x11/detect_prime_x11.cpp
@@ -41,8 +41,7 @@
#include "thirdparty/glad/glad/gl.h"
#include "thirdparty/glad/glad/glx.h"
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
+#include "dynwrappers/xlib-so_wrap.h"
#include <cstring>
@@ -89,6 +88,10 @@ void create_context() {
None
};
+ if (gladLoaderLoadGLX(x11_display, XScreenNumberOfScreen(XDefaultScreenOfDisplay(x11_display))) == 0) {
+ print_verbose("Unable to load GLX, GPU detection skipped.");
+ quick_exit(1);
+ }
int fbcount;
GLXFBConfig fbconfig = nullptr;
XVisualInfo *vi = nullptr;
@@ -189,11 +192,6 @@ int detect_prime() {
setenv("DRI_PRIME", "1", 1);
}
- if (gladLoaderLoadGLX(NULL, 0) == 0) {
- print_verbose("Unable to load GLX, GPU detection skipped.");
- quick_exit(1);
- }
-
create_context();
PFNGLGETSTRINGPROC glGetString = (PFNGLGETSTRINGPROC)glXGetProcAddressARB((GLubyte *)"glGetString");