1WAFFLE_INIT(3) Waffle Manual WAFFLE_INIT(3)
2
3
4
6 waffle_init - Initialize waffle's per-process global state
7
9 #include <waffle.h>
10
11 bool waffle_init(const int32_t attrib_list[]);
12
14 waffle_init() initializes the per-process global state of the waffle
15 library with the attributes specified in attrib_list. The set of
16 attributes is documented below. attrib_list consists of a
17 zero-terminated sequence of name/value pairs.
18
19 Most waffle functions emit an error if called when waffle is
20 unitialized. The small set of functions that can be successfully called
21 before initialization are explicitly documented as such.
22
23 If a call to waffle_init() fails, no global state is initialized and
24 the caller may safely attempt to call waffle_init() again. If waffle
25 has already been initialized by a successful call to waffle_init() one
26 has to call waffle_teardown() to clear the global state. Otherwise
27 calling waffle_init() again emits the error
28 WAFFLE_ERROR_ALREADY_INITIALIZED.
29
31 WAFFLE_PLATFORM
32 This attribute is required. Possible values are:
33
34 WAFFLE_PLATFORM_ANDROID
35 [Android] Use EGL on Android.
36
37 WAFFLE_PLATFORM_GBM
38 [Linux] Use EGL with GBM, the "Generic Buffer Manager" provided
39 by libgbm. This platform is capable of OpenGL rendering without
40 a display manager.
41
42 WAFFLE_PLATFORM_CGL
43 [MacOS] Use CGL to create the waffle_config(3) and
44 waffle_context(3). Use Cocoa to create the waffle_window(3).
45
46 WAFFLE_PLATFORM_GLX
47 [Linux only, MacOS not yet supported]
48
49 WAFFLE_PLATFORM_NACL
50 [Linux only, other systems not yet supported]
51
52 WAFFLE_PLATFORM_SURFACELESS_EGL
53 [Linux] Use EGL's "surfaceless" platform,
54 EGL_MESA_platform_surfaceless[1].
55
56 WAFFLE_PLATFORM_WAYLAND
57 [Linux] Use EGL with the Wayland display server.
58
59 WAFFLE_PLATFORM_WGL
60 [Windows] Use WGL on Windows.
61
62 WAFFLE_PLATFORM_X11_EGL
63 [Linux] Use EGL with the X11 display server.
64
65
67 Functions whose return type is bool return true on success and false on
68 failure. Functions whose return type is a pointer return NULL on
69 failure. Use waffle_error_get_info(3) to get information about any
70 errors.
71
73 See waffle_error(3) for the complete list of waffle's error codes.
74
75 Listed are the errors specific to waffle_init().
76
77 WAFFLE_ERROR_ALREADY_INITIALIZED
78 Waffle has already been initialized with a successful call to
79 waffle_init().
80
81 WAFFLE_ERROR_BAD_ATTRIBUTE
82 An item in attrib_list is unrecognized or has an invalid value, or
83 a required attribute is missing.
84
85 WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT
86 Waffle was built without support for the requested attribute.
87
89 Initialize waffle for X11/EGL.
90
91
92 #include <waffle.h>
93
94 static const int32_t init_attrib_list[] = {
95 WAFFLE_PLATFORM, WAFFLE_PLATFORM_X11_EGL,
96 0,
97 };
98
99 int
100 main()
101 {
102 bool ok = waffle_init(init_attrib_list);
103 if (ok)
104 return EXIT_SUCCESS;
105 else
106 return EXIT_FAILURE;
107 }
108
109
110
112 Please report bugs or and feature requests to
113 https://gitlab.freedesktop.org/mesa/waffle/issues.
114
116 waffle(7)
117
119 Chad Versace <chad.versace@linux.intel.com>
120 Maintainer
121
123 Copyright © 2013 Intel
124
125 This manual page is licensed under the Creative Commons
126 Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To
127 view a copy of this license, visit
128 http://creativecommons.org.license/by-sa/3.0/us.
129
130
132 1. EGL_MESA_platform_surfaceless
133 https://www.khronos.org/registry/egl/extensions/MESA/EGL_MESA_platform_surfaceless.txt
134
135
136
137waffle 07/22/2023 WAFFLE_INIT(3)