diff options
author | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2021-12-17 15:02:21 -0500 |
---|---|---|
committer | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2021-12-17 16:08:13 -0500 |
commit | 3c198aecaa9970ba7f8a87fa9400ee6a79f1f35c (patch) | |
tree | 965b1d62a91a7803fef3e6f60ec087bd37ab6ad6 | |
parent | b0e93711b36bae3d2bb3a7e9a4a88faf055499fb (diff) |
Sync detect_prime_x11.cpp formatting changes from 3.x branch
-rw-r--r-- | platform/linuxbsd/detect_prime_x11.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/linuxbsd/detect_prime_x11.cpp b/platform/linuxbsd/detect_prime_x11.cpp index c775546f15..5bcfc44f12 100644 --- a/platform/linuxbsd/detect_prime_x11.cpp +++ b/platform/linuxbsd/detect_prime_x11.cpp @@ -91,7 +91,7 @@ void create_context() { }; int fbcount; - GLXFBConfig fbconfig = 0; + GLXFBConfig fbconfig = nullptr; XVisualInfo *vi = nullptr; XSetWindowAttributes swa; @@ -100,8 +100,9 @@ void create_context() { unsigned long valuemask = CWBorderPixel | CWColormap | CWEventMask; GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs, &fbcount); - if (!fbc) + if (!fbc) { exit(1); + } vi = glXGetVisualFromFBConfig(x11_display, fbc[0]); @@ -120,8 +121,9 @@ void create_context() { swa.colormap = XCreateColormap(x11_display, RootWindow(x11_display, vi->screen), vi->visual, AllocNone); x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, 10, 10, 0, vi->depth, InputOutput, vi->visual, valuemask, &swa); - if (!x11_window) + if (!x11_window) { exit(1); + } glXMakeCurrent(x11_display, x11_window, glx_context); XFree(vi); @@ -179,8 +181,9 @@ int detect_prime() { close(fdset[0]); - if (i) + if (i) { setenv("DRI_PRIME", "1", 1); + } create_context(); const char *vendor = (const char *)glGetString(GL_VENDOR); |