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">
6 <refentrytitle>glDetachShader
</refentrytitle>
7 <manvolnum>3G
</manvolnum>
10 <refname>glDetachShader
</refname>
11 <refpurpose>Detaches a shader object from a program object to which it is attached
</refpurpose>
13 <refsynopsisdiv><title>C Specification
</title>
16 <funcdef>void
<function>glDetachShader
</function></funcdef>
17 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
18 <paramdef>GLuint
<parameter>shader
</parameter></paramdef>
22 <refsect1 id=
"parameters"><title>Parameters
</title>
25 <term><parameter>program
</parameter></term>
27 <para>Specifies the program object from which to
28 detach the shader object.
</para>
32 <term><parameter>shader
</parameter></term>
34 <para>Specifies the shader object to be
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>
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>
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>
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>
62 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
63 <parameter>program
</parameter> is not a program object.
</para>
65 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
66 <parameter>shader
</parameter> is not a shader object.
</para>
68 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
69 <parameter>shader
</parameter> is not attached to
70 <parameter>program
</parameter>.
</para>
72 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
73 <function>glDetachShader
</function> is executed between the
75 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
76 and the corresponding execution of
77 <citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
</para>
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>
83 <para><citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>
84 with arguments
<parameter>shader
</parameter> and
85 <constant>GL_DELETE_STATUS
</constant></para>
87 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry></para>
89 <para><citerefentry><refentrytitle>glIsShader
</refentrytitle></citerefentry></para>
91 <refsect1 id=
"seealso"><title>See Also
</title>
92 <para><citerefentry><refentrytitle>glAttachShader
</refentrytitle></citerefentry></para>
94 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.