File: waffle_make_current.3.xml

package info (click to toggle)
waffle 1.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,092 kB
  • sloc: ansic: 19,173; xml: 2,906; cpp: 489; objc: 465; sh: 100; makefile: 20
file content (193 lines) | stat: -rw-r--r-- 6,601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  "file:///usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd">

<!--
  Copyright Intel 2012

  This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
  US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
-->

<refentry
    id="waffle_make_current"
    xmlns:xi="http://www.w3.org/2001/XInclude">

  <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->

  <refmeta>
    <refentrytitle>waffle_make_current</refentrytitle>
    <manvolnum>3</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>waffle_make_current</refname>
    <refname>waffle_get_current_display</refname>
    <refname>waffle_get_current_window</refname>
    <refname>waffle_get_current_context</refname>
    <refpurpose>set and get resources current to the thread</refpurpose>
  </refnamediv>

  <refentryinfo>
    <title>Waffle Manual</title>
    <productname>waffle</productname>
    <xi:include href="common/author-chad.versace.xml"/>
    <xi:include href="common/copyright.xml"/>
    <xi:include href="common/legalnotice.xml"/>
  </refentryinfo>

  <refsynopsisdiv>
    <funcsynopsis language="C">

      <funcsynopsisinfo>
#include &lt;waffle.h&gt;
      </funcsynopsisinfo>

      <funcprototype>
        <funcdef>bool <function>waffle_make_current</function></funcdef>
        <paramdef>struct waffle_display *<parameter>display</parameter></paramdef>
        <paramdef>struct waffle_window *<parameter>window</parameter></paramdef>
        <paramdef>struct waffle_context *<parameter>context</parameter></paramdef>
      </funcprototype>

      <funcprototype>
        <funcdef>struct waffle_display *<function>waffle_get_current_display</function></funcdef><void/>
      </funcprototype>

      <funcprototype>
        <funcdef>struct waffle_window *<function>waffle_get_current_window</function></funcdef><void/>
      </funcprototype>

      <funcprototype>
        <funcdef>struct waffle_context *<function>waffle_get_current_context</function></funcdef><void/>
      </funcprototype>

    </funcsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <variablelist>

      <varlistentry>
        <term><function>waffle_make_current()</function></term>
        <listitem>
          <para>
            Bind the given <parameter>window</parameter> and <parameter>context</parameter>

            for rendering on the current thread.

            <parameter>window</parameter> and <parameter>context</parameter>

            must both have been created on the given <parameter>display</parameter>.

            To unbind the current context without binding a new one,

            set <parameter>window</parameter> and <parameter>context</parameter> to <constant>NULL</constant>.
          </para>

          <para>
            This function is analogous to

            <citerefentry><refentrytitle><function>glXMakeCurrent</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
            <citerefentry><refentrytitle><function>eglMakeCurrent</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>, and
            <function>[NSOpenGLContext makeCurrentContext]</function>.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_get_current_display()</function></term>
        <listitem>
          <para>
            Get the display bound to the current thread,
            as previously bound by <function>waffle_make_current()</function>.
            If no display is bound, then return NULL.
          </para>

          <para>
            This function is analogous to
            <citerefentry><refentrytitle><function>glXGetCurrentDisplay</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
            <citerefentry><refentrytitle><function>eglGetCurrentDisplay</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_get_current_window()</function></term>
        <listitem>
          <para>
            Get the window bound to the current thread,
            as previously bound by <function>waffle_make_current()</function>.
            If no window is bound, then return NULL.
          </para>

          <para>
            This function is analogous to
            <citerefentry><refentrytitle><function>glXGetCurrentDrawable</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
            <citerefentry><refentrytitle><function>eglGetCurrentSurface</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_get_current_context()</function></term>
        <listitem>
          <para>
            Get the context bound to the current thread,
            as previously bound by <function>waffle_make_current()</function>.
            If no context is bound, then return NULL.
          </para>

          <para>
            This function is analogous to
            <citerefentry><refentrytitle><function>glXGetCurrentContext</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> and
            <citerefentry><refentrytitle><function>eglGetCurrentContext</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
          </para>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1>
    <title>Return Value</title>
    <xi:include href="common/return-value.xml"/>
  </refsect1>

  <refsect1>
    <title>Errors</title>

    <xi:include href="common/error-codes.xml"/>

    <para>
      No errors are specific to any functions listed in this manual page.
    </para>
  </refsect1>

  <refsect1>
    <title>Bugs</title>
    <para>
      Mixing calls to <function>waffle_make_current()</function>
      and the native platform's <function>MakeCurrent()</function>
      on the same thread do not interact well.
      After calling the native platform's <function>MakeCurrent()</function>,
      future Waffle function calls on the same thread are likely to behave incorrectly.
    </para>
  </refsect1>

  <xi:include href="common/issues.xml"/>

  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
    </para>
  </refsect1>

</refentry>

<!--
vim:tw=120 et ts=2 sw=2:
-->