Created
February 3, 2019 14:41
-
-
Save yshui/097e91c1d457ea00cf804f4d614da46c to your computer and use it in GitHub Desktop.
madness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc glx.c -lX11 -lGL | |
#include <GL/glx.h> | |
#include <X11/Xlib.h> | |
#include <stdio.h> | |
int main() { | |
Display *dpy = XOpenDisplay(NULL); | |
int scr = DefaultScreen(dpy); | |
int ncfg; | |
GLXFBConfig *fbs = glXGetFBConfigs(dpy, scr, &ncfg); | |
for (int i = 0; i < ncfg; i++) { | |
int fbid, vid; | |
glXGetFBConfigAttrib(dpy, fbs[i], GLX_FBCONFIG_ID, &fbid); | |
glXGetFBConfigAttrib(dpy, fbs[i], GLX_VISUAL_ID, &vid); | |
printf("%lx %lx\n", fbid, vid); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment