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="glGetShader"> | |
5 | <refmeta> | |
6 | <refentrytitle>glGetShader</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glGetShaderiv</refname> | |
11 | <refpurpose>Returns a parameter from a shader object</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
16 | <funcdef>void <function>glGetShaderiv</function></funcdef> | |
17 | <paramdef>GLuint <parameter>shader</parameter></paramdef> | |
18 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
19 | <paramdef>GLint *<parameter>params</parameter></paramdef> | |
20 | </funcprototype> | |
21 | </funcsynopsis> | |
22 | </refsynopsisdiv> | |
23 | <refsect1 id="parameters"><title>Parameters</title> | |
24 | <variablelist> | |
25 | <varlistentry> | |
26 | <term><parameter>shader</parameter></term> | |
27 | <listitem> | |
28 | <para>Specifies the shader object to be | |
29 | queried.</para> | |
30 | </listitem> | |
31 | </varlistentry> | |
32 | <varlistentry> | |
33 | <term><parameter>pname</parameter></term> | |
34 | <listitem> | |
35 | <para>Specifies the object parameter. Accepted | |
36 | symbolic names are | |
37 | <constant>GL_SHADER_TYPE</constant>, | |
38 | <constant>GL_DELETE_STATUS</constant>, | |
39 | <constant>GL_COMPILE_STATUS</constant>, | |
40 | <constant>GL_INFO_LOG_LENGTH</constant>, | |
41 | <constant>GL_SHADER_SOURCE_LENGTH</constant>.</para> | |
42 | </listitem> | |
43 | </varlistentry> | |
44 | <varlistentry> | |
45 | <term><parameter>params</parameter></term> | |
46 | <listitem> | |
47 | <para>Returns the requested object parameter.</para> | |
48 | </listitem> | |
49 | </varlistentry> | |
50 | </variablelist> | |
51 | </refsect1> | |
52 | <refsect1 id="description"><title>Description</title> | |
53 | ||
54 | <para><function>glGetShader</function> | |
55 | returns in <parameter>params</parameter> | |
56 | the value of a parameter for a specific shader object. The | |
57 | following parameters are defined:</para> | |
58 | ||
59 | <variablelist> | |
60 | <varlistentry> | |
61 | <term><constant>GL_SHADER_TYPE</constant></term> | |
62 | <listitem> | |
63 | <para> <parameter>params</parameter> returns | |
64 | <constant>GL_VERTEX_SHADER</constant> if | |
65 | <parameter>shader</parameter> is a vertex shader | |
66 | object, and <constant>GL_FRAGMENT_SHADER</constant> | |
67 | if <parameter>shader</parameter> is a fragment | |
68 | shader object.</para> | |
69 | </listitem> | |
70 | </varlistentry> | |
71 | ||
72 | <varlistentry> | |
73 | <term><constant>GL_DELETE_STATUS</constant></term> | |
74 | <listitem> | |
75 | <para> <parameter>params</parameter> returns | |
76 | <constant>GL_TRUE</constant> if | |
77 | <parameter>shader</parameter> is currently flagged | |
78 | for deletion, and <constant>GL_FALSE</constant> | |
79 | otherwise.</para> | |
80 | </listitem> | |
81 | </varlistentry> | |
82 | ||
83 | <varlistentry> | |
84 | <term><constant>GL_COMPILE_STATUS</constant></term> | |
85 | <listitem> | |
86 | <para> <parameter>params</parameter> returns | |
87 | <constant>GL_TRUE</constant> if the last compile | |
88 | operation on <parameter>shader</parameter> was | |
89 | successful, and <constant>GL_FALSE</constant> | |
90 | otherwise.</para> | |
91 | </listitem> | |
92 | </varlistentry> | |
93 | ||
94 | <varlistentry> | |
95 | <term><constant>GL_INFO_LOG_LENGTH</constant></term> | |
96 | <listitem> | |
97 | <para> <parameter>params</parameter> returns the | |
98 | number of characters in the information log for | |
99 | <parameter>shader</parameter> including the null | |
100 | termination character (i.e., the size of the | |
101 | character buffer required to store the information | |
102 | log). If <parameter>shader</parameter> has no | |
103 | information log, a value of 0 is returned.</para> | |
104 | </listitem> | |
105 | </varlistentry> | |
106 | ||
107 | <varlistentry> | |
108 | <term><constant>GL_SHADER_SOURCE_LENGTH</constant></term> | |
109 | <listitem> | |
110 | <para> <parameter>params</parameter> returns the | |
111 | length of the concatenation of the source strings | |
112 | that make up the shader source for the | |
113 | <parameter>shader</parameter>, including the null | |
114 | termination character. (i.e., the size of the | |
115 | character buffer required to store the shader | |
116 | source). If no source code exists, 0 is | |
117 | returned.</para> | |
118 | </listitem> | |
119 | </varlistentry> | |
120 | </variablelist> | |
121 | </refsect1> | |
122 | <refsect1 id="notes"><title>Notes</title> | |
123 | <para><function>glGetShader</function> is available only if the | |
124 | GL version is 2.0 or greater.</para> | |
125 | ||
126 | <para>If an error is generated, no change is made to the | |
127 | contents of <parameter>params</parameter>.</para> | |
128 | </refsect1> | |
129 | <refsect1 id="errors"><title>Errors</title> | |
130 | <para><constant>GL_INVALID_VALUE</constant> is generated if | |
131 | <parameter>shader</parameter> is not a value generated by | |
132 | OpenGL.</para> | |
133 | ||
134 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
135 | <parameter>shader</parameter> does not refer to a shader | |
136 | object.</para> | |
137 | ||
138 | <para><constant>GL_INVALID_ENUM</constant> is generated if | |
139 | <parameter>pname</parameter> is not an accepted value.</para> | |
140 | ||
141 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
142 | <function>glGetShader</function> is executed between the | |
143 | execution of | |
144 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
145 | and the corresponding execution of | |
146 | <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para> | |
147 | </refsect1> | |
148 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
149 | <para><citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry> | |
150 | with argument <parameter>shader</parameter></para> | |
151 | ||
152 | <para><citerefentry><refentrytitle>glGetShaderSource</refentrytitle></citerefentry> | |
153 | with argument <parameter>shader</parameter></para> | |
154 | ||
155 | <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para> | |
156 | </refsect1> | |
157 | <refsect1 id="seealso"><title>See Also</title> | |
158 | <para><citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>, | |
159 | <citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>, | |
160 | <citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>, | |
161 | <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>, | |
162 | <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para> | |
163 | </refsect1> | |
164 | <refsect1 id="Copyright"><title>Copyright</title> | |
165 | <para> | |
166 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
167 | This material may be distributed subject to the terms and conditions set forth in | |
168 | the Open Publication License, v 1.0, 8 June 1999. | |
169 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
170 | </para> | |
171 | </refsect1> | |
172 | </refentry> |