Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glDetachShader"> | |
5 | <refmeta> | |
6 | <refentrytitle>glDetachShader</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glDetachShader</refname> | |
11 | <refpurpose>Detaches a shader object from a program object to which it is attached</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
16 | <funcdef>void <function>glDetachShader</function></funcdef> | |
17 | <paramdef>GLuint <parameter>program</parameter></paramdef> | |
18 | <paramdef>GLuint <parameter>shader</parameter></paramdef> | |
19 | </funcprototype> | |
20 | </funcsynopsis> | |
21 | </refsynopsisdiv> | |
22 | <refsect1 id="parameters"><title>Parameters</title> | |
23 | <variablelist> | |
24 | <varlistentry> | |
25 | <term><parameter>program</parameter></term> | |
26 | <listitem> | |
27 | <para>Specifies the program object from which to | |
28 | detach the shader object.</para> | |
29 | </listitem> | |
30 | </varlistentry> | |
31 | <varlistentry> | |
32 | <term><parameter>shader</parameter></term> | |
33 | <listitem> | |
34 | <para>Specifies the shader object to be | |
35 | detached.</para> | |
36 | </listitem> | |
37 | </varlistentry> | |
38 | </variablelist> | |
39 | </refsect1> | |
40 | <refsect1 id="description"><title>Description</title> | |
41 | <para><function>glDetachShader</function> detaches the shader | |
42 | object specified by <parameter>shader</parameter> from the | |
43 | program object specified by <parameter>program</parameter>. This | |
44 | command can be used to undo the effect of the command | |
45 | <citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>.</para> | |
46 | ||
47 | <para>If <parameter>shader</parameter> has already been flagged | |
48 | for deletion by a call to | |
49 | <citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry> | |
50 | and it is not attached to any other program object, it will be | |
51 | deleted after it has been detached.</para> | |
52 | </refsect1> | |
53 | <refsect1 id="notes"><title>Notes</title> | |
54 | <para><function>glDetachShader</function> is available only if | |
55 | the GL version is 2.0 or greater.</para> | |
56 | </refsect1> | |
57 | <refsect1 id="errors"><title>Errors</title> | |
58 | <para><constant>GL_INVALID_VALUE</constant> is generated if either | |
59 | <parameter>program</parameter> or <parameter>shader</parameter> | |
60 | is a value that was not generated by OpenGL.</para> | |
61 | ||
62 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
63 | <parameter>program</parameter> is not a program object.</para> | |
64 | ||
65 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
66 | <parameter>shader</parameter> is not a shader object.</para> | |
67 | ||
68 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
69 | <parameter>shader</parameter> is not attached to | |
70 | <parameter>program</parameter>.</para> | |
71 | ||
72 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
73 | <function>glDetachShader</function> is executed between the | |
74 | execution of | |
75 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
76 | and the corresponding execution of | |
77 | <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para> | |
78 | </refsect1> | |
79 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
80 | <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry> | |
81 | with the handle of a valid program object</para> | |
82 | ||
83 | <para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry> | |
84 | with arguments <parameter>shader</parameter> and | |
85 | <constant>GL_DELETE_STATUS</constant></para> | |
86 | ||
87 | <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para> | |
88 | ||
89 | <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para> | |
90 | </refsect1> | |
91 | <refsect1 id="seealso"><title>See Also</title> | |
92 | <para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry></para> | |
93 | </refsect1> | |
94 | <refsect1 id="Copyright"><title>Copyright</title> | |
95 | <para> | |
96 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
97 | This material may be distributed subject to the terms and conditions set forth in | |
98 | the Open Publication License, v 1.0, 8 June 1999. | |
99 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
100 | </para> | |
101 | </refsect1> | |
102 | </refentry> |