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(),
26 then calling waffle_init() again emits the error
27 WAFFLE_ERROR_ALREADY_INITIALIZED.
28
30 WAFFLE_PLATFORM
31 This attribute is required. Possible values are:
32
33 WAFFLE_PLATFORM_ANDROID
34 [Android] Use EGL on Android.
35
36 WAFFLE_PLATFORM_GBM
37 [Linux] Use EGL with GBM, the "Generic Buffer Manager" provided
38 by libgbm. This platform is capable of OpenGL rendering without
39 a display manager.
40
41 WAFFLE_PLATFORM_CGL
42 [MacOS] Use CGL to create the waffle_config(3) and
43 waffle_context(3). Use Cocoa to create the waffle_window(3).
44
45 WAFFLE_PLATFORM_GLX
46 [Linux only, MacOS not yet supported]
47
48 WAFFLE_PLATFORM_WAYLAND
49 [Linux] Use EGL with the Wayland display server.
50
51 WAFFLE_PLATFORM_WGL
52 [Windows] Use WGL on Windows.
53
54 WAFFLE_PLATFORM_X11_EGL
55 [Linux] Use EGL with the X11 display server.
56
57
59 Functions whose return type is bool return true on success and false on
60 failure. Functions whose return type is a pointer return NULL on
61 failure. Use waffle_error_get_info(3) to get information about any
62 errors.
63
65 See waffle_error(3) for the complete list of waffle's error codes.
66
67 Listed are the errors specific to waffle_init().
68
69 WAFFLE_ERROR_ALREADY_INITIALIZED
70 Waffle has already been initialized with a successfull call to
71 waffle_init().
72
73 WAFFLE_ERROR_BAD_ATTRIBUTE
74 An item in attrib_list is unrecognized or has an invalid value, or
75 a required attribute is missing.
76
77 WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT
78 Waffle was built without support for the requested attribute.
79
81 Initialize waffle for X11/EGL.
82
83
84 #include <waffle.h>
85
86 static const int32_t init_attrib_list[] = {
87 WAFFLE_PLATFORM, WAFFLE_PLATFORM_X11_EGL,
88 0,
89 };
90
91 int
92 main()
93 {
94 bool ok = waffle_init(init_attrib_list);
95 if (ok)
96 return EXIT_SUCCESS;
97 else
98 return EXIT_FAILURE;
99 }
100
101
102
104 Please report bugs or and feature requests to
105 https://github.com/waffle-gl/waffle/issues.
106
108 waffle(7)
109
111 Chad Versace <chad.versace@linux.intel.com>
112 Maintainer
113
115 Copyright © 2013 Intel
116
117 This manual page is licensed under the Creative Commons
118 Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To
119 view a copy of this license, visit
120 http://creativecommons.org.license/by-sa/3.0/us.
121
122
123
124
125waffle 02/03/2019 WAFFLE_INIT(3)