WAFFLE_CONTEXT(3)
β¨ WAFFLE_CONTEXT(3) β¨
okay bestie, sit down, we're doing the Waffle Manual today π this is the page all about the β¨contextβ¨ β the thing that holds your OpenGL rendering state. no cap.
π NAME π
waffle_context, waffle_context_create, waffle_context_destroy, waffle_context_get_native β the whole class waffle_context friend group π«Ά
π¦ SYNOPSIS π¦
#include <waffle.h>
struct waffle_context;
struct waffle_context*
waffle_context_create(struct waffle_config *config,
struct waffle_context *shared_ctx);
bool waffle_context_destroy(struct waffle_context *self);
union waffle_native_context*
waffle_context_get_native(struct waffle_context *self);
πΈ DESCRIPTION πΈ
struct waffle_context
it's an opaque type bestie. you don't get to peek inside, that's the whole vibe π
waffle_context_create()
makes you a context for OpenGL rendering, with the properties that config says you want. slay.
here's the tea tho: the context you actually get back? its real properties may differ from what you asked for in config β but they're guaranteed to be compatible with them. if you want the full rundown, go read the VERSION PROMOTION section down below π
and if share_ctx is not null, then your brand-new context gets added to the share group of share_ctx. some data β display lists, for example β is shared between every context in the same share group. wanna know exactly what's shared? go look at the spec for whichever native platform you're on: the GLX 1.4 Specification[1], the EGL 1.4 Specification[2], or the CGL Reference[3]. iykyk π
waffle_context_destroy()
destroys the context and frees its memory. it's giving closure, periodt π§Ή
waffle_context_get_native()
grabs the context's underlying native objects. use free(3) to deallocate the pointer you get back, don't just leave it lying there π and if you wanna know what union waffle_native_context even is, that's over in waffle_native(3).
π VERSION PROMOTION π
so the version and profile you asked for come from these config attributes: WAFFLE_CONTEXT_MAJOR_VERSION, WAFFLE_CONTEXT_MINOR_VERSION, WAFFLE_CONTEXT_PROFILE. but the context waffle_context_create hands you back? it may implement any version and profile that is backwards compatible with what you requested. here's exactly how that works:
- if the chosen API is
WAFFLE_OPENGL_ES1,WAFFLE_OPENGL_ES2, orWAFFLE_OPENGL_ES3, then the returned context may implement any of:- the requested version.
- any later version, so long as no features have been from that later version.
- if the chosen API is
WAFFLE_CONTEXT_OPENGLand version 3.0 or less is requested, then the returned context may implement any of:- any version no less than that requested and no greater than
3.0. - version
3.1, if theGL_ARB_compatibilityextension is also implemented. - the compatibility profile of version
3.2or greater.
- any version no less than that requested and no greater than
- if the chosen API is
WAFFLE_CONTEXT_OPENGLand version3.1is requested, then the returned context may implement any of:- version
3.1, with or without theGL_ARB_compatibilityextension. - the core profile of version
3.2or greater.
- version
- if the chosen API is
WAFFLE_CONTEXT_OPENGLand version3.2or greater is requested, then the returned context may implement any of:- the requested profile and version.
- the requested profile of any later version, so long as no features have been from that later version and profile.
π RETURN VALUE π
- functions whose return type is
boolreturntrueon success andfalseon failure. yes queen, binary π - functions whose return type is a pointer return
NULLon failure. sad but true π - either way, hit up
waffle_error_get_info(3)to find out what the errors were about π
π ERRORS π
the complete list of waffle's error codes lives in waffle_error(3), go check it.
and listen: No errors are specific to the waffle_context functions. like, none. zero. that's it. π«Ά
π ISSUES π
found a bug? got a feature request? don't be shy bestie, report it here:
https://gitlab.freedesktop.org/mesa/waffle/issues
β SEE ALSO β
waffle(7) waffle_config_choose(3)
π AUTHOR π
Chad Versace <chad.versace@linux.intel.com> Former maintainer
π COPYRIGHT π
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 π§
- GLX 1.4 Specification http://www.opengl.org/registry/doc/glx1.4.pdf
- EGL 1.4 Specification http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf
- CGL Reference https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html
and that's the whole page, bestie!! you ate π this was waffle, dated 07/06/2026, page WAFFLE_CONTEXT(3) β go forth and render something iconic π
β¨
π¦ where this page comes from
- ubuntu stonking: libwaffle-doc 1.8.3-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms