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="glCompileShader"> | |
5 | <refmeta> | |
6 | <refentrytitle>glCompileShader</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glCompileShader</refname> | |
11 | <refpurpose>Compiles a shader object</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
16 | <funcdef>void <function>glCompileShader</function></funcdef> | |
17 | <paramdef>GLuint <parameter>shader</parameter></paramdef> | |
18 | </funcprototype> | |
19 | </funcsynopsis> | |
20 | </refsynopsisdiv> | |
21 | <refsect1 id="parameters"><title>Parameters</title> | |
22 | <variablelist> | |
23 | <varlistentry> | |
24 | <term><parameter>shader</parameter></term> | |
25 | <listitem> | |
26 | <para>Specifies the shader object to be | |
27 | compiled.</para> | |
28 | </listitem> | |
29 | </varlistentry> | |
30 | </variablelist> | |
31 | </refsect1> | |
32 | <refsect1 id="description"><title>Description</title> | |
33 | <para><function>glCompileShader</function> compiles the source | |
34 | code strings that have been stored in the shader object | |
35 | specified by <parameter>shader</parameter>.</para> | |
36 | ||
37 | <para>The compilation status will be stored as part of the | |
38 | shader object's state. This value will be set to | |
39 | <constant>GL_TRUE</constant> if the shader was compiled without | |
40 | errors and is ready for use, and <constant>GL_FALSE</constant> | |
41 | otherwise. It can be queried by calling | |
42 | <citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry> | |
43 | with arguments <parameter>shader</parameter> and | |
44 | <constant>GL_COMPILE_STATUS</constant>.</para> | |
45 | ||
46 | <para>Compilation of a shader can fail for a number of reasons | |
47 | as specified by the OpenGL Shading Language Specification. | |
48 | Whether or not the compilation was successful, information about | |
49 | the compilation can be obtained from the shader object's | |
50 | information log by calling | |
51 | <citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>.</para> | |
52 | </refsect1> | |
53 | <refsect1 id="notes"><title>Notes</title> | |
54 | <para><function>glCompileShader</function> | |
55 | is available only if 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 | |
59 | <parameter>shader</parameter> is not a value generated by | |
60 | OpenGL.</para> | |
61 | ||
62 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
63 | <parameter>shader</parameter> is not a shader object.</para> | |
64 | ||
65 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
66 | <function>glCompileShader</function> is executed between the | |
67 | execution of | |
68 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
69 | and the corresponding execution of | |
70 | <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para> | |
71 | </refsect1> | |
72 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
73 | <para><citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry> | |
74 | with argument <parameter>shader</parameter></para> | |
75 | ||
76 | <para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry> | |
77 | with arguments <parameter>shader</parameter> and | |
78 | <constant>GL_COMPILE_STATUS</constant></para> | |
79 | <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para> | |
80 | </refsect1> | |
81 | <refsect1 id="seealso"><title>See Also</title> | |
82 | <para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>, | |
83 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>, | |
84 | <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para> | |
85 | </refsect1> | |
86 | <refsect1 id="Copyright"><title>Copyright</title> | |
87 | <para> | |
88 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
89 | This material may be distributed subject to the terms and conditions set forth in | |
90 | the Open Publication License, v 1.0, 8 June 1999. | |
91 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
92 | </para> | |
93 | </refsect1> | |
94 | </refentry> |