xcb_dri2_swap_buffers(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… xcb_dri2_swap_buffers β€” the XCB Requests girlies know

okay so bestie, welcome to xcb_dri2_swap_buffers(3) ✨ this is the XCB request that's giving "swap those buffers, queen" β€” it lives in the DRI2 corner of libxcb and it's part of the XCB Requests family. let's get into it 🫢


✨ SYNOPSIS ✨

first up, the include. do not forget the include, i'm begging 😭

#include <xcb/dri2.h>

πŸŽ€ Request function

xcb_dri2_swap_buffers_cookie_t
       xcb_dri2_swap_buffers(xcb_connection_t *conn,
       xcb_drawable_t drawable, uint32_t target_msc_hi,
       uint32_t target_msc_lo, uint32_t divisor_hi, uint32_t divisor_lo,
       uint32_t remainder_hi, uint32_t remainder_lo);

πŸŽ€ Reply datastructure

look at this struct. she's structured. she's iconic. πŸ’–

typedef struct xcb_dri2_swap_buffers_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint32_t swap_hi;
    uint32_t swap_lo;
} xcb_dri2_swap_buffers_reply_t;

πŸŽ€ Reply function

xcb_dri2_swap_buffers_reply_t
       *xcb_dri2_swap_buffers_reply(xcb_connection_t *conn,
       xcb_dri2_swap_buffers_cookie_t cookie, xcb_generic_error_t **e);

🌸 REQUEST ARGUMENTS 🌸

every single one of them, no skipping, we're thorough in this household πŸ‘‘

  • conn β€” The XCB connection to X11. your lil red telephone to the server, basically πŸ“ž
  • drawable β€” TODO: NOT YET DOCUMENTED. yeah bestie, the docs literally just said "idk yet" πŸ’€
  • target_msc_hi β€” TODO: NOT YET DOCUMENTED. same energy πŸ™ˆ
  • target_msc_lo β€” TODO: NOT YET DOCUMENTED. the silence is deafening 😭
  • divisor_hi β€” TODO: NOT YET DOCUMENTED.
  • divisor_lo β€” TODO: NOT YET DOCUMENTED.
  • remainder_hi β€” TODO: NOT YET DOCUMENTED.
  • remainder_lo β€” TODO: NOT YET DOCUMENTED.
ngl the upstream docs left the whole argument list as a to-do list and never came back. we're not gonna invent lore. if it says TODO, it says TODO, periodt. βœ‹

πŸ¦‹ REPLY FIELDS πŸ¦‹

  • response_type β€” The type of this reply, in this case XCB_DRI2_SWAP_BUFFERS. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. it's the name tag at the party, so you know who walked in πŸ’…
  • sequence β€” The sequence number of the last request processed by the X11 server. the receipts, basically 🧾
  • length β€” The length of the reply, in words (a word is 4 bytes). math girlies rise 🌈
  • swap_hi β€” TODO: NOT YET DOCUMENTED.
  • swap_lo β€” TODO: NOT YET DOCUMENTED.

πŸ’œ DESCRIPTION πŸ’œ

so… the description section is just. empty. like, there is literally nothing in it. the original page has the heading and then vibes and then the next heading. not me defending a blank section but that's genuinely what's there, bestie πŸ™ˆ no cap.


⭐ RETURN VALUE ⭐

Returns an xcb_dri2_swap_buffers_cookie_t. πŸͺ Errors have to be handled when calling the reply function xcb_dri2_swap_buffers_reply.

If you want to handle errors in the event loop instead, use xcb_dri2_swap_buffers_unchecked. See xcb-requests(3) for details.

so like β€” the cookie is your lil voucher, and you cash it in at the reply function. that's the whole plot πŸŽ€


πŸ”₯ ERRORS πŸ”₯

This request does never generate any errors. zero. none. she's unbothered, she's thriving, she does not do drama 🌸


🌈 SEE ALSO 🌈

okay so this section is also empty on the actual page. nothing listed. not a single reference. it's giving minimalism, it's giving "we ran out of time" 😭 we're keeping it real and keeping it empty.


πŸ‘‘ AUTHOR πŸ‘‘

Generated from dri2.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. yes you can actually email them, they want to hear from you 🫢


and that's the whole page bestie!! πŸ’–

cute lil sign-off: this one ships with X Version 11, libxcb 1.17.0, and the page header/footer is literally just xcb_dri2_swap_buffers(3) on both ends β€” same girl, same title, no notes. πŸ’…βœ¨