gitlab-ci: update container to bullseye
[mesa-waffle.git] / man / waffle_make_current.3.xml
blobb1d0e10be2c70add2237d0eb9ae062f3dd6fe748
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5 <!--
6   Copyright Intel 2012
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.
10 -->
12 <refentry
13     id="waffle_make_current"
14     xmlns:xi="http://www.w3.org/2001/XInclude">
16   <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->
18   <refmeta>
19     <refentrytitle>waffle_make_current</refentrytitle>
20     <manvolnum>3</manvolnum>
21   </refmeta>
23   <refnamediv>
24     <refname>waffle_make_current</refname>
25     <refname>waffle_get_current_display</refname>
26     <refname>waffle_get_current_window</refname>
27     <refname>waffle_get_current_context</refname>
28     <refpurpose>set and get resources current to the thread</refpurpose>
29   </refnamediv>
31   <refentryinfo>
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"/>
37   </refentryinfo>
39   <refsynopsisdiv>
40     <funcsynopsis language="C">
42       <funcsynopsisinfo>
43 #include &lt;waffle.h&gt;
44       </funcsynopsisinfo>
46       <funcprototype>
47         <funcdef>bool <function>waffle_make_current</function></funcdef>
48         <paramdef>struct waffle_display *<parameter>display</parameter></paramdef>
49         <paramdef>struct waffle_window *<parameter>window</parameter></paramdef>
50         <paramdef>struct waffle_context *<parameter>context</parameter></paramdef>
51       </funcprototype>
53       <funcprototype>
54         <funcdef>struct waffle_display *<function>waffle_get_current_display</function></funcdef><void/>
55       </funcprototype>
57       <funcprototype>
58         <funcdef>struct waffle_window *<function>waffle_get_current_window</function></funcdef><void/>
59       </funcprototype>
61       <funcprototype>
62         <funcdef>struct waffle_context *<function>waffle_get_current_context</function></funcdef><void/>
63       </funcprototype>
65     </funcsynopsis>
66   </refsynopsisdiv>
68   <refsect1>
69     <title>Description</title>
71     <variablelist>
73       <varlistentry>
74         <term><function>waffle_make_current()</function></term>
75         <listitem>
76           <para>
77             Bind the given <parameter>window</parameter> and <parameter>context</parameter>
79             for rendering on the current thread.
81             <parameter>window</parameter> and <parameter>context</parameter>
83             must both have been created on the given <parameter>display</parameter>.
85             To unbind the current context without binding a new one,
87             set <parameter>window</parameter> and <parameter>context</parameter> to <constant>NULL</constant>.
88           </para>
90           <para>
91             This function is analogous to
93             <citerefentry><refentrytitle><function>glXMakeCurrent</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
94             <citerefentry><refentrytitle><function>eglMakeCurrent</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>, and
95             <function>[NSOpenGLContext makeCurrentContext]</function>.
96           </para>
97         </listitem>
98       </varlistentry>
100       <varlistentry>
101         <term><function>waffle_get_current_display()</function></term>
102         <listitem>
103           <para>
104             Get the display bound to the current thread,
105             as previously bound by <function>waffle_make_current()</function>.
106             If no display is bound, then return NULL.
107           </para>
109           <para>
110             This function is analogous to
111             <citerefentry><refentrytitle><function>glXGetCurrentDisplay</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
112             <citerefentry><refentrytitle><function>eglGetCurrentDisplay</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
113           </para>
114         </listitem>
115       </varlistentry>
117       <varlistentry>
118         <term><function>waffle_get_current_window()</function></term>
119         <listitem>
120           <para>
121             Get the window bound to the current thread,
122             as previously bound by <function>waffle_make_current()</function>.
123             If no window is bound, then return NULL.
124           </para>
126           <para>
127             This function is analogous to
128             <citerefentry><refentrytitle><function>glXGetCurrentDrawable</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
129             <citerefentry><refentrytitle><function>eglGetCurrentSurface</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
130           </para>
131         </listitem>
132       </varlistentry>
134       <varlistentry>
135         <term><function>waffle_get_current_context()</function></term>
136         <listitem>
137           <para>
138             Get the context bound to the current thread,
139             as previously bound by <function>waffle_make_current()</function>.
140             If no context is bound, then return NULL.
141           </para>
143           <para>
144             This function is analogous to
145             <citerefentry><refentrytitle><function>glXGetCurrentContext</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
146             <citerefentry><refentrytitle><function>eglGetCurrentContext</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
147           </para>
148         </listitem>
149       </varlistentry>
151     </variablelist>
152   </refsect1>
154   <refsect1>
155     <title>Return Value</title>
156     <xi:include href="common/return-value.xml"/>
157   </refsect1>
159   <refsect1>
160     <title>Errors</title>
162     <xi:include href="common/error-codes.xml"/>
164     <para>
165       No errors are specific to any functions listed in this manual page.
166     </para>
167   </refsect1>
169   <refsect1>
170     <title>Bugs</title>
171     <para>
172       Mixing calls to <function>waffle_make_current()</function>
173       and the native platform's <function>MakeCurrent()</function>
174       on the same thread do not interact well.
175       After calling the native platform's <function>MakeCurrent()</function>,
176       future Waffle function calls on the same thread are likely to behave incorrectly.
177     </para>
178   </refsect1>
180   <xi:include href="common/issues.xml"/>
182   <refsect1>
183     <title>See Also</title>
184     <para>
185       <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
186     </para>
187   </refsect1>
189 </refentry>
191 <!--
192 vim:tw=120 et ts=2 sw=2: