summaryrefslogtreecommitdiff
path: root/engine-ocean/External/glew/auto/EGL-Registry/sdk/docs/man/eglReleaseThread.xml
blob: 6f6021583de5051f1982fd9969a9d92a16f70e31 (plain)
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
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglReleaseThread">
    <info>
         <copyright>
             <year>2003-2014</year>
             <holder>The Khronos Group Inc.</holder>
         </copyright>
    </info>
    <refmeta>
        <refentrytitle>eglReleaseThread</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>eglReleaseThread</refname>
        <refpurpose>Release EGL per-thread state</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>EGLBoolean <function>eglReleaseThread</function></funcdef>
                <void/>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 xml:id="description"><title>Description</title>
        <para>
            <function>eglReleaseThread</function> returns the EGL to its
            state at thread initialization, releasing all per-thread
            state including the error status returned by
            <command>eglGetError</command>, the currently bound
            rendering API defined by <command>eglBindAPI</command>, and
            the current contexts for each supported client API. The
            overhead of maintaining this state may be objectionable in
            applications which create and destroy many threads, but only
            call EGL or client APIs in a few of those threads at any
            given time.
        </para>
        <para>
            <constant>EGL_TRUE</constant> is returned on success, and the
            following actions are taken:
        </para>
        <itemizedlist>
            <listitem>
                <para>
                    For each client API supported by EGL, if there is a
                    currently bound context, that context is released.
                    This is equivalent to calling
                    <function>eglMakeCurrent</function> with ctx set to
                    <constant>EGL_NO_CONTEXT</constant> and both draw
                    and read set to <constant>EGL_NO_SURFACE</constant>
                    (see section 3.7.3).
                </para>
            </listitem>
            <listitem>
                <para>
                    The current rendering API is reset to its value at
                    thread initialization (see
                    <command>eglBindAPI</command>).
                </para>
            </listitem>
            <listitem>
                <para>
                    Any additional implementation-dependent per-thread
                    state maintained by EGL is marked for deletion as
                    soon as possible.
                </para>
            </listitem>
        </itemizedlist>
        <para>
            <function>eglReleaseThread</function> may be called in any
            thread at any time, and may be called more than once in a
            single thread. The initialization status of EGL (see section
            3.2) is not affected by releasing the thread; only
            per-thread state is affected.
        </para>
        <para>
            Resources explicitly allocated by calls to EGL, such as
            contexts, surfaces, and configuration lists, are not
            affected by <function>eglReleaseThread</function>. Such
            resources belong not to the thread, but to the EGL
            implementation as a whole.
        </para>
    </refsect1>
    <refsect1 xml:id="notes"><title>Notes</title>
        <para>
            <function>eglReleaseThread</function> is supported only if the
            EGL version is 1.2 or greater.
        </para>
        <para>
            Applications may call other EGL routines from a thread
            following <function>eglReleaseThread</function>, but any
            such call may reallocate the EGL state previously released.
            In particular, calling <function>eglGetError</function>
            immediately following a successful call to
            <function>eglReleaseThread</function> will return
            <constant>EGL_SUCCESS</constant>, but will also result in
            reallocating per-thread state.
        </para>
    </refsect1>
    <refsect1 xml:id="errors"><title>Errors</title>
        <para>
            <constant>EGL_FALSE</constant> is returned on failure,
            <constant>EGL_TRUE</constant> otherwise. There are no
            defined conditions under which failure will occur. Even if
            EGL is not initialized on any EGLDisplay,
            <function>eglReleaseThread</function> should succeed.
        </para>
        <para>
            However, platform-dependent failures may be signaled through
            the value returned from <function>eglGetError</function>.
            Unless the platform-dependent behavior is known, a failed
            call to <function>eglReleaseThread</function> should be
            assumed to leave the current rendering API, and the
            currently bound contexts for each supported client API, in
            an unknown state.
        </para>
    </refsect1>
    <refsect1 xml:id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>eglBindAPI</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>eglGetError</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="copyright.xml"/>
</refentry>