2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
8 This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
9 US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
14 xmlns:xi="http://www.w3.org/2001/XInclude">
16 <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->
19 <refentrytitle>waffle_context</refentrytitle>
20 <manvolnum>3</manvolnum>
24 <refname>waffle_context</refname>
25 <refname>waffle_context_create</refname>
26 <refname>waffle_context_destroy</refname>
27 <refname>waffle_context_get_native</refname>
28 <refpurpose>class <classname>waffle_context</classname></refpurpose>
32 <title>Waffle Manual</title>
33 <productname>waffle</productname>
34 <xi:include href="common/author-chad.versace.xml"/>
35 <xi:include href="common/copyright.xml"/>
36 <xi:include href="common/legalnotice.xml"/>
41 <funcsynopsis language="C">
44 #include <waffle.h>
46 struct waffle_context;
50 <funcdef>struct waffle_context* <function>waffle_context_create</function></funcdef>
51 <paramdef>struct waffle_config *<parameter>config</parameter></paramdef>
52 <paramdef>struct waffle_context *<parameter>shared_ctx</parameter></paramdef>
56 <funcdef>bool <function>waffle_context_destroy</function></funcdef>
57 <paramdef>struct waffle_context *<parameter>self</parameter></paramdef>
61 <funcdef>union waffle_native_context* <function>waffle_context_get_native</function></funcdef>
62 <paramdef>struct waffle_context *<parameter>self</parameter></paramdef>
69 <title>Description</title>
74 <term><type>struct waffle_context</type></term>
83 <term><function>waffle_context_create()</function></term>
86 Create a context for OpenGL rendering with the properties specified by <parameter>config</parameter>.
90 The returned context's actual properties may differ from,
91 but are guaranteed to be compatible with,
92 the properties specified by <parameter>config</parameter>.
94 See <xref linkend="sect.version_promotion"/> below for details.
98 If <parameter>share_ctx</parameter> is not null, then the newly created context is added to the share group
99 of <parameter>share_ctx</parameter>. Some data, such as display lists, are shared among all contexts
100 that belong to the same share group. For details on what data is shared, see the specification for the
101 relevant native platform:
102 the <ulink url="http://www.opengl.org/registry/doc/glx1.4.pdf">GLX 1.4 Specification</ulink>,
103 the <ulink url="http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf">EGL 1.4 Specification</ulink>,
104 or the <ulink url="https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html">CGL Reference</ulink>.
110 <term><function>waffle_context_destroy()</function></term>
113 Destroy the context and release its memory.
119 <term><function>waffle_context_get_native()</function></term>
122 Get the context's underlying native objects. Use
123 <citerefentry><refentrytitle><function>free</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> to deallocate the
125 See <citerefentry><refentrytitle><function>waffle_native</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>
126 for the definition of <type>union waffle_native_context</type>.
135 id="sect.version_promotion">
137 <title>Version Promotion</title>
140 The context's requested version and profile is given by the config attributes
142 <constant>WAFFLE_CONTEXT_MAJOR_VERSION</constant>,
143 <constant>WAFFLE_CONTEXT_MINOR_VERSION</constant>,
144 <constant>WAFFLE_CONTEXT_PROFILE</constant>.
146 The context returned by <function>waffle_context_create</function>
147 may implement any version and profile
148 that is backwards compatible with that requested,
156 <constant>WAFFLE_OPENGL_ES1</constant>,
157 <constant>WAFFLE_OPENGL_ES2</constant>, or
158 <constant>WAFFLE_OPENGL_ES3</constant>,
160 then the returned context may implement any of:
162 <simplelist type="vert">
163 <member>* The requested version.</member>
164 <member>* Any later version, so long as no features have been from that later version.</member>
171 If the chosen API is <constant>WAFFLE_CONTEXT_OPENGL</constant>
173 and version 3.0 or less is requested,
175 then the returned context may implement any of:
177 <simplelist type="vert">
178 <member>* Any version no less than that requested and no greater than 3.0.</member>
179 <member>* Version 3.1, if the GL_ARB_compatibility extension is also implemented.</member>
180 <member>* The compatibility profile of version 3.2 or greater.</member>
187 If the chosen API is <constant>WAFFLE_CONTEXT_OPENGL</constant>
189 and version 3.1 is requested,
191 then the returned context may implement any of:
193 <simplelist type="vert">
194 <member>* Version 3.1, with or without the GL_ARB_compatibility extension.</member>
195 <member>* The core profile of version 3.2 or greater.</member>
202 If the chosen API is <constant>WAFFLE_CONTEXT_OPENGL</constant>
204 and version 3.2 or greater is requested,
206 then the returned context may implement any of:
208 <simplelist type="vert">
209 <member>* The requested profile and version.</member>
211 * The requested profile of any later version, so long as no features have been from that later
224 <title>Return Value</title>
225 <xi:include href="common/return-value.xml"/>
229 <title>Errors</title>
231 <xi:include href="common/error-codes.xml"/>
234 No errors are specific to the <type>waffle_context</type> functions.
238 <xi:include href="common/issues.xml"/>
241 <title>See Also</title>
243 <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
244 <citerefentry><refentrytitle>waffle_config_choose</refentrytitle><manvolnum>3</manvolnum></citerefentry>
251 vim:tw=120 et ts=2 sw=2: