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=
"errors"><title>Errors
</title>
54 <para><constant>GL_INVALID_VALUE
</constant> is generated if either
55 <parameter>program
</parameter> or
<parameter>shader
</parameter>
56 is a value that was not generated by OpenGL.
</para>
58 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
59 <parameter>program
</parameter> is not a program object.
</para>
61 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
62 <parameter>shader
</parameter> is not a shader object.
</para>
64 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
65 <parameter>shader
</parameter> is not attached to
66 <parameter>program
</parameter>.
</para>
69 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
70 <para><citerefentry><refentrytitle>glGetAttachedShaders
</refentrytitle></citerefentry>
71 with the handle of a valid program object
</para>
73 <para><citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>
74 with arguments
<parameter>shader
</parameter> and
75 <constant>GL_DELETE_STATUS
</constant></para>
77 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry></para>
79 <para><citerefentry><refentrytitle>glIsShader
</refentrytitle></citerefentry></para>
81 <refsect1 id=
"seealso"><title>See Also
</title>
82 <para><citerefentry><refentrytitle>glAttachShader
</refentrytitle></citerefentry></para>
84 <refsect1 id=
"Copyright"><title>Copyright
</title>
86 Copyright
<trademark class=
"copyright"></trademark> 2003-
2005 3Dlabs Inc. Ltd.
87 This material may be distributed subject to the terms and conditions set forth in
88 the Open Publication License, v
1.0,
8 June
1999.
89 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.