1WAFFLE_CONTEXT(3) Waffle Manual WAFFLE_CONTEXT(3)
2
3
4
6 waffle_context, waffle_context_create, waffle_context_destroy,
7 waffle_context_get_native - class waffle_context
8
10 #include <waffle.h>
11
12 struct waffle_context;
13
14
15 struct waffle_context*
16 waffle_context_create(struct waffle_config *config,
17 struct waffle_context *shared_ctx);
18
19 bool waffle_context_destroy(struct waffle_context *self);
20
21 union waffle_native_context*
22 waffle_context_get_native(struct waffle_context *self);
23
25 struct waffle_context
26 An opaque type.
27
28 waffle_context_create()
29 Create a context for OpenGL rendering with the properties specified
30 by config.
31
32 The returned context's actual properties may differ from, but are
33 guaranteed to be compatible with, the properties specified by
34 config. See the section called “VERSION PROMOTION” below for
35 details.
36
37 If share_ctx is not null, then the newly created context is added
38 to the share group of share_ctx. Some data, such as display lists,
39 are shared among all contexts that belong to the same share group.
40 For details on what data is shared, see the specification for the
41 relevant native platform: the GLX 1.4 Specification[1], the EGL 1.4
42 Specification[2], or the CGL Reference[3].
43
44 waffle_context_destroy()
45 Destroy the context and release its memory.
46
47 waffle_context_get_native()
48 Get the context's underlying native objects. Use free(3) to
49 deallocate the returned pointer. See waffle_native(3) for the
50 definition of union waffle_native_context.
51
53 The context's requested version and profile is given by the config
54 attributes WAFFLE_CONTEXT_MAJOR_VERSION, WAFFLE_CONTEXT_MINOR_VERSION,
55 WAFFLE_CONTEXT_PROFILE. The context returned by waffle_context_create
56 may implement any version and profile that is backwards compatible with
57 that requested, as described below.
58
59 • If the chosen API is WAFFLE_OPENGL_ES1, WAFFLE_OPENGL_ES2, or
60 WAFFLE_OPENGL_ES3, then the returned context may implement any of:
61 * The requested version.
62 * Any later version, so long as no features have been from that
63 later version.
64
65 • If the chosen API is WAFFLE_CONTEXT_OPENGL and version 3.0 or less
66 is requested, then the returned context may implement any of:
67 * Any version no less than that requested and no greater than
68 3.0.
69 * Version 3.1, if the GL_ARB_compatibility extension is also
70 implemented.
71 * The compatibility profile of version 3.2 or greater.
72
73 • If the chosen API is WAFFLE_CONTEXT_OPENGL and version 3.1 is
74 requested, then the returned context may implement any of:
75 * Version 3.1, with or without the GL_ARB_compatibility
76 extension.
77 * The core profile of version 3.2 or greater.
78
79 • If the chosen API is WAFFLE_CONTEXT_OPENGL and version 3.2 or
80 greater is requested, then the returned context may implement any
81 of:
82 * The requested profile and version.
83 * The requested profile of any later version, so long as no
84 features have been from that later version and profile.
85
86
88 Functions whose return type is bool return true on success and false on
89 failure. Functions whose return type is a pointer return NULL on
90 failure. Use waffle_error_get_info(3) to get information about any
91 errors.
92
94 See waffle_error(3) for the complete list of waffle's error codes.
95
96 No errors are specific to the waffle_context functions.
97
99 Please report bugs or and feature requests to
100 https://gitlab.freedesktop.org/mesa/waffle/issues.
101
103 waffle(7) waffle_config_choose(3)
104
106 Chad Versace <chad.versace@linux.intel.com>
107 Maintainer
108
110 Copyright © 2013 Intel
111
112 This manual page is licensed under the Creative Commons
113 Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To
114 view a copy of this license, visit
115 http://creativecommons.org.license/by-sa/3.0/us.
116
117
119 1. GLX 1.4 Specification
120 http://www.opengl.org/registry/doc/glx1.4.pdf
121
122 2. EGL 1.4 Specification
123 http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf
124
125 3. CGL Reference
126 https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html
127
128
129
130waffle 02/02/2023 WAFFLE_CONTEXT(3)