WAFFLE_WINDOW(3)

πŸŽ€ NAME πŸŽ€

hey bestie πŸ’– welcome to WAFFLE_WINDOW(3), straight out of the Waffle Manual β€” this is the page all about the class waffle_window, and it covers these icons right here:

  • waffle_window
  • waffle_window_create
  • waffle_window_destroy
  • waffle_window_show
  • waffle_window_swap_buffers
  • waffle_window_get_native

(and yes, waffle_window_create2 shows up too, keep scrolling 🫢)


✨ SYNOPSIS ✨

#include <waffle.h>

struct waffle_window;

struct waffle_window* waffle_window_create(struct waffle_window *config,
                                           int32_t width,
                                           int32_t height);

struct waffle_window*
                                            waffle_window_create2(struct waffle_window *config,
                                            const intptr_t attrib_list[]);

bool waffle_window_destroy(struct waffle_window *self);

bool waffle_window_show(struct waffle_window *self);

bool waffle_window_swap_buffers(struct waffle_window *self);

union waffle_native_window*
                                                             waffle_window_get_native(struct waffle_window *self);

🌈 DESCRIPTION 🌈

okay so, one by one, no skipping, we're going through all of them πŸ’…

struct waffle_window

it's an opaque type. that's it, that's the whole vibe. you don't get to peek inside, and honestly? respect. πŸ”₯

waffle_window_create()

makes you a window with all the properties that config says. πŸͺŸ

and here's the fun part β€” if the platform allows it, the window is not slapped onto the screen right after creation. nope. she's shy. to actually make her appear you gotta call waffle_window_show(). main character entrance, delayed. periodt ✨

waffle_window_create2()

feature test macro situation: WAFFLE_API_VERSION >= 0x0106. (go read waffle_feature_test_macros(7) for the tea 🍡)

this one creates a window using the properties from config and attrib_list. and attrib_list has to specify the window size in one of exactly two ways β€” no improvising:

  • with the attributes WAFFLE_WINDOW_WIDTH and WAFFLE_WINDOW_HEIGHT, both set to positive values that are <= INT32_MAX, or
  • with the attribute WAFFLE_WINDOW_FULLSCREEN equal to true(1). 🌸

waffle_window_destroy()

destroys the window and releases her memory. rest in peace queen πŸ’€ she ate and now she's gone.

waffle_window_show()

puts the window up on the display, front and center, icon behavior πŸ‘‘

but lowkey β€” if the window is already shown, or if the native platform straight up doesn't support showing windows (hi GBM πŸ’–), then it just does nothing and returns true. no drama, no error, we chill.

waffle_window_swap_buffers()

so if the window is double-buffered, this implicitly calls glFlush() and posts the contents of the back buffer to the front buffer. putting in the work, showing the results ✨

if the window is front-buffered, it does nothing. okay, she's resting.

and for the platform-specific details of swap semantics? go read the spec for whichever native platform you're on, bestie:

  • the GLX 1.4 Specification [1]
  • the EGL 1.4 Specification [2]
  • or the CGL Reference [3]

(receipts are down at the bottom in NOTES, I got you 🫢)

waffle_window_get_native()

grabs the window's underlying native objects. when you're done with the pointer it gives you, free it with free(3), okay? don't just leave it there to rot πŸ™ˆ

and if you wanna know what union waffle_native_window even is, that's a waffle_native(3) situation.


πŸ’… RETURN VALUE πŸ’…

  • functions returning bool: true on success, false on failure.
  • functions returning a pointer: NULL on failure.
  • wanna know why something flopped? call waffle_error_get_info(3) to get the full info about any errors. πŸ”

😭 ERRORS 😭

go look at waffle_error(3) for the complete list of waffle's error codes β€” the whole menu, not just the snacks.

and ngl: no errors are specific to the waffle_window functions. there's nothing extra hiding here. clean page, clean vibes ✨


πŸ› ISSUES πŸ›

found a bug? want a feature? please report that to:

https://gitlab.freedesktop.org/mesa/waffle/issues

we love a link drop 🫢


πŸ”— SEE ALSO πŸ”—


πŸ‘‘ AUTHOR πŸ‘‘

Chad Versace <chad.versace@linux.intel.com>

  • Former maintainer

thank you for your service, legend 🌸


Copyright Β© 2013 Intel

this manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). to view a copy of this license, visit:

http://creativecommons.org.license/by-sa/3.0/us


πŸ“ NOTES πŸ“

  1. GLX 1.4 Specification http://www.opengl.org/registry/doc/glx1.4.pdf
  2. EGL 1.4 Specification http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf
  3. CGL Reference https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html

and that's the whole page bestie, you made it to the end πŸŽ‰ this was the waffle manual, dated 07/06/2026, page WAFFLE_WINDOW(3). go make some windows, slay, and hydrate πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from