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.
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. -->
19 <refentrytitle>waffle_make_current</refentrytitle>
20 <manvolnum>3</manvolnum>
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>
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"/>
40 <funcsynopsis language="C">
43 #include <waffle.h>
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>
54 <funcdef>struct waffle_display *<function>waffle_get_current_display</function></funcdef><void/>
58 <funcdef>struct waffle_window *<function>waffle_get_current_window</function></funcdef><void/>
62 <funcdef>struct waffle_context *<function>waffle_get_current_context</function></funcdef><void/>
69 <title>Description</title>
74 <term><function>waffle_make_current()</function></term>
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>.
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>.
101 <term><function>waffle_get_current_display()</function></term>
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.
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>.
118 <term><function>waffle_get_current_window()</function></term>
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.
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>.
135 <term><function>waffle_get_current_context()</function></term>
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.
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>.
155 <title>Return Value</title>
156 <xi:include href="common/return-value.xml"/>
160 <title>Errors</title>
162 <xi:include href="common/error-codes.xml"/>
165 No errors are specific to any functions listed in this manual page.
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.
180 <xi:include href="common/issues.xml"/>
183 <title>See Also</title>
185 <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
192 vim:tw=120 et ts=2 sw=2: