GLXGETCONFIG(3gl)
β¨ GLXGETCONFIG β¨
okay bestie, buckle up β this is the GLXGETCONFIG page from the 3G manual, and it's literally the "hey what's up with this visual" function π
πΈ NAME πΈ
glXGetConfig β returns info about GLX visuals π¦
π C SPECIFICATION π
int glXGetConfig( Display *dpy,
XVisualInfo *vis,
int attrib,
int *value )
delim $$
(yes the delim $$ is in there, we don't make the rules, we just report them π)
π«Ά PARAMETERS π«Ά
dpyβ the connection to the X server. your lil phone line to X πvisβ the visual you're asking about. heads up: it's a pointer to anXVisualInfostructure, not a visual ID and not a pointer to aVisual. this trips people up fr fr, so read it twice πattribβ which visual attribute you want back.valueβ where the requested value gets written. it returns the value, as in it fills this in for you β¨
π DESCRIPTION π
glXGetConfig sets value to the attrib value of windows or GLX pixmaps created with respect to vis. If it fails for literally any reason, glXGetConfig returns an error code. Otherwise? zero. that's it, zero, we love a clean success π«Ά
So attrib is one of these, bestie π
GLX_USE_GLβ True if OpenGL rendering is supported by this visual, False otherwise.GLX_BUFFER_SIZEβ number of bits per color buffer. For RGBA visuals,GLX_BUFFER_SIZEis the sum ofGLX_RED_SIZE,GLX_GREEN_SIZE,GLX_BLUE_SIZE, andGLX_ALPHA_SIZE. For color index visuals,GLX_BUFFER_SIZEis the size of the color indexes.GLX_LEVELβ frame buffer level of the visual. Level zero is the default frame buffer. Positive levels correspond to frame buffers that overlay the default buffer, and negative levels correspond to frame buffers that underlay the default buffer. so like, above and below the default, iconic πGLX_RGBAβ True if color buffers store red, green, blue, and alpha values. False if they store color indexes.GLX_DOUBLEBUFFERβ True if color buffers exist in front/back pairs that can be swapped, False otherwise.GLX_STEREOβ True if color buffers exist in left/right pairs, False otherwise.GLX_AUX_BUFFERSβ number of auxiliary color buffers that are available. Zero indicates that no auxiliary color buffers exist.GLX_RED_SIZEβ number of bits of red stored in each color buffer. Undefined ifGLX_RGBAis False. β οΈ undefined, not "zero", not "we'll guess" β undefined.GLX_GREEN_SIZEβ number of bits of green stored in each color buffer. Undefined ifGLX_RGBAis False.GLX_BLUE_SIZEβ number of bits of blue stored in each color buffer. Undefined ifGLX_RGBAis False.GLX_ALPHA_SIZEβ number of bits of alpha stored in each color buffer. Undefined ifGLX_RGBAis False.GLX_DEPTH_SIZEβ number of bits in the depth buffer.GLX_STENCIL_SIZEβ number of bits in the stencil buffer.GLX_ACCUM_RED_SIZEβ number of bits of red stored in the accumulation buffer.GLX_ACCUM_GREEN_SIZEβ number of bits of green stored in the accumulation buffer.GLX_ACCUM_BLUE_SIZEβ number of bits of blue stored in the accumulation buffer.GLX_ACCUM_ALPHA_SIZEβ number of bits of alpha stored in the accumulation buffer.
The X protocol allows a single visual ID to be instantiated with different numbers of bits per pixel. Windows or GLX pixmaps that will be rendered with OpenGL, however, must be instantiated with a color buffer depth of GLX_BUFFER_SIZE. like, no negotiating on that one π
Although a GLX implementation can export many visuals that support GL rendering, it must support at least one RGBA visual. This visual must have at least one color buffer, a stencil buffer of at least 1 bit, a depth buffer of at least 12 bits, and an accumulation buffer. Alpha bitplanes are optional in this visual. However, its color buffer size must be as great as that of the deepest TrueColor, DirectColor, PseudoColor, or StaticColor visual supported on level zero, and it must itself be made available on level zero. π
In addition, if the X server exports a PseudoColor or StaticColor visual on framebuffer level 0, a color index visual is also required on that level. It must have at least one color buffer, a stencil buffer of at least 1 bit, and a depth buffer of at least 12 bits. This visual must have as many color bitplanes as the deepest PseudoColor or StaticColor visual supported on level 0.
Applications are best written to select the visual that most closely meets their requirements. Creating windows or GLX pixmaps with unnecessary buffers can result in reduced rendering performance as well as poor resource allocation. translation: don't be greedy with buffers, it's giving messy π
π¦ NOTES π¦
XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visualID, screen, and depth elements. that's your lil cheat sheet π
π ERRORS π
GLX_NO_EXTENSIONis returned ifdpydoes not support the GLX extension.GLX_BAD_SCREENis returned if the screen ofvisdoes not correspond to a screen.GLX_BAD_ATTRIBUTEis returned ifattribis not a valid GLX attribute.GLX_BAD_VISUALis returned ifvisdoesn't support GLX and an attribute other thanGLX_USE_GLis requested.
so if you ask forGLX_DEPTH_SIZEon a visual that doesn't do GLX, that's aGLX_BAD_VISUALfor you. the only thing you're allowed to ask a non-GLX visual isGLX_USE_GL, and spoiler, the answer's gonna be False π
π SEE ALSO π
glXChooseVisual, glXCreateContext
and that's the whole page, bestie, no cap π this was GLXGETCONFIG() from the 3G manual β go forth and vibe-check your visuals, you're the main character of your own framebuffer πβ¨πΈ
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms