XdbeGetVisualInfo(3)

πŸ’– XdbeGetVisualInfo β€” bestie edition πŸ’–

okay so this is a page from the X FUNCTIONS manual, and it's all about XdbeGetVisualInfo(3). yes that's the whole title, no notes, she's iconic like that ✨


✨ NAME ✨

XdbeGetVisualInfo β€” get dbe Visual Information πŸ‘‘


🌸 SYNOPSIS 🌸

#include <X11/extensions/Xdbe.h>

XdbeScreenVisualInfo *XdbeGetVisualInfo(
    Display  *dpy,
    Drawable *screen_specifiers,
    int      *num_screens)

πŸ’… DESCRIPTION πŸ’…

okay bestie, listen. this function is literally just handing you the tea about which visuals support double buffering 🫢

so num_screens tells her how many elements are chilling in the screen_specifiers list. and each drawable in screen_specifiers? it's designating a screen β€” like, "hey, I want the supported visuals for this one please" πŸ’β€β™€οΈ

but here's the plot twist: if num_screens is zero, then you're requesting info for all screens, periodt. and in that case, when the function comes back, num_screens gets set to the number of screens that were found πŸ‘€

if an error happens, this function returns NULL. otherwise? she returns a pointer to a list of XdbeScreenVisualInfo structures of length num_screens 🌈

now the mapping, and this matters:

  • the *n*th element in the returned list corresponds to the *n*th drawable in the screen_specifiers list
  • UNLESS num_screens was passed in with the value zero β€” in which case the *n*th element in the returned list corresponds to the *n*th screen of the server, starting with screen zero 🌟

the XdbeScreenVisualInfo structure πŸŽ€

she has these fields, and yes we're keeping them exactly:

int            count
XdbeVisualInfo *visinfo
  • count β€” specifies the number of items in visinfo
  • visinfo β€” specifies a list of visuals, depths, and performance hints for this screen

the XdbeVisualInfo structure πŸ¦‹

and this one has:

VisualID visual
int      depth
int      perflevel
  • visual β€” specifies one visual ID that supports double-buffering
  • depth β€” specifies the depth of the visual
  • perflevel β€” a performance hint

now about perflevel, because the way this is worded is very specific and we're respecting it: the only operation defined on a perflevel is comparison to a perflevel of another visual on the same screen. the visual having the higher perflevel is likely to have better double-buffering graphics performance than the visual having the lower perflevel πŸ”₯

and you literally cannot deduce anything from these, no cap: - the magnitude of the difference of two perflevels - a perflevel value in isolation - comparing perflevels from different servers

like, don't do it. it's giving undefined vibes and it will not slay 😭


πŸ’€ ERRORS πŸ’€

  • BadDrawable β€” one or more values passed in screen_specifiers is not a valid drawable. (rude, honestly πŸ™ˆ)

πŸ‘‘ SEE ALSO πŸ‘‘

DBE, XdbeAllocateBackBufferName(), XdbeBeginIdiom(), XdbeDeallocateBackBufferName(), XdbeEndIdiom(), XdbeFreeVisualInfo(), XdbeGetBackBufferAttributes(), XdbeQueryExtension(), XdbeSwapBuffers() 🫢


okay that's the whole page, mwah πŸ’‹ this was X Version 11, libXext 1.3.6, and yeah XdbeGetVisualInfo(3) β€” go forth and double buffer, bestie, you ate πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from