1WAFFLE_CONFIG(3)                 Waffle Manual                WAFFLE_CONFIG(3)
2
3
4

NAME

6       waffle_config, waffle_config_choose, waffle_config_destroy,
7       waffle_config_get_native - class waffle_config
8

SYNOPSIS

10       #include <waffle.h>
11
12       struct waffle_config;
13
14
15       struct waffle_config*
16                                                  waffle_config_choose(struct waffle_display *display,
17                                                  const int32_t attrib_list[]);
18
19       bool waffle_config_destroy(struct waffle_config *self);
20
21       union waffle_native_config*
22                                                            waffle_config_get_native(struct waffle_config *self);
23

DESCRIPTION

25       struct waffle_config
26           An opaque type.
27
28       waffle_config_choose()
29           Choose a config on display that satifisfies the set of attributes
30           specified by attrib_list. The config can later be used to create
31           surfaces and contexts with waffle_window_create(3) and
32           waffle_context_create(3).
33
34           attrib_list consists of a zero-terminated sequence of name/value
35           pairs. If an attribute is absent from attrib_list, then it assumes
36           its default value. If attrib_list is null, then it is intrepreted
37           the same as the empty list, which is the list that contains only
38           the terminal zero. See the section called “ATTRIBUTES” below for
39           details on the set of attributes that may appear in attrib_list.
40
41
42       waffle_config_destroy()
43           Destroy the config and release its memory.
44
45       waffle_config_get_native()
46           Get the config's underlying native objects. Use free(3) to
47           deallocate the returned pointer. See waffle_native(3) for the
48           definition of union waffle_native_config.
49

DISCUSSION

51       The context attributes (WAFFLE_CONTEXT_*) have quirks that are specific
52       to the native platform. Waffle attempts to accomdate those quirks in a
53       platform-neutral way as much as possible, but not all quirks can be
54       eliminated through a platform abstraction layer. The quirks are
55       documented below in detail.
56
57       For example, one quirk that Waffle is able to accommodate is that some
58       platforms require specification of context attributes at different
59       times. GLX requires that the context attributes be specified at time of
60       context creation [glXCreateContextAttribsARB(3)] but MacOS requires the
61       attributes to be specified when choosing a config
62       [CGLChoosePixelFormat]. Therefore, Waffle is constrained by MacOS to
63       require the attributes at time of waffle_config_choose().
64
65       For additional documentation on the behavior of context attributes on
66       each platform, refer to the following:
67
68           For GLX, refer to the GLX 1.4 Specification[1] and the
69           specifications for extensions GLX_ARB_create_context_profile[2] and
70           GLX_EXT_create_context_es2_profile[3].
71
72           For EGL, refer to the EGL 1.4 Specification[4] and the
73           specifications for extension EGL_KHR_create_context[5].
74
75           For CGL, refer to the documentation of kCGLPFAOpenGLProfile in the
76           CGL Reference[6].