waffle_context - Man Page

class waffle_context


#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);


struct waffle_context

An opaque type.


Create a context for OpenGL rendering with the properties specified by config.

The returned context's actual properties may differ from, but are guaranteed to be compatible with, the properties specified by config. See the section called “Version Promotion” below for details.

If share_ctx is not null, then the newly created context is added to the share group of share_ctx. Some data, such as display lists, are shared among all contexts that belong to the same share group. For details on what data is shared, see the specification for the relevant native platform: the GLX 1.4 Specification[1], the EGL 1.4 Specification[2], or the CGL Reference[3].


Destroy the context and release its memory.


Get the context's underlying native objects. Use free(3) to deallocate the returned pointer. See waffle_native(3) for the definition of union waffle_native_context.

Version Promotion

The context's requested version and profile is given by the config attributes WAFFLE_CONTEXT_MAJOR_VERSION, WAFFLE_CONTEXT_MINOR_VERSION, WAFFLE_CONTEXT_PROFILE. The context returned by waffle_context_create may implement any version and profile that is backwards compatible with that requested, as described below.

Return Value

Functions whose return type is bool return true on success and false on failure. Functions whose return type is a pointer return NULL on failure. Use waffle_error_get_info(3) to get information about any errors.


See waffle_error(3) for the complete list of waffle's error codes.

No errors are specific to the waffle_context functions.


Please report bugs or and feature requests to https://gitlab.freedesktop.org/mesa/waffle/issues.

See Also

waffle(7) waffle_config_choose(3)


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



  1. GLX 1.4 Specification
  2. EGL 1.4 Specification
  3. CGL Reference

Referenced By

waffle(7), waffle_config(3), waffle_display(3), waffle_init(3).

The man pages waffle_context_create(3), waffle_context_destroy(3) and waffle_context_get_native(3) are aliases of waffle_context(3).

07/23/2021 Waffle Manual