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=
"glGetMaterial">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glGetMaterial
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetMaterial
</refname>
17 <refpurpose>return material parameters
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetMaterialfv
</function></funcdef>
23 <paramdef>GLenum
<parameter>face
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
25 <paramdef>GLfloat *
<parameter>params
</parameter></paramdef>
30 <funcdef>void
<function>glGetMaterialiv
</function></funcdef>
31 <paramdef>GLenum
<parameter>face
</parameter></paramdef>
32 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
33 <paramdef>GLint *
<parameter>params
</parameter></paramdef>
37 <!-- eqn: ignoring delim $$ -->
38 <refsect1 id=
"parameters"><title>Parameters
</title>
41 <term><parameter>face
</parameter></term>
44 Specifies which of the two materials is being queried.
45 <constant>GL_FRONT
</constant> or
<constant>GL_BACK
</constant> are accepted,
46 representing the front and back materials,
52 <term><parameter>pname
</parameter></term>
55 Specifies the material parameter to return.
56 <constant>GL_AMBIENT
</constant>,
57 <constant>GL_DIFFUSE
</constant>,
58 <constant>GL_SPECULAR
</constant>,
59 <constant>GL_EMISSION
</constant>,
60 <constant>GL_SHININESS
</constant>, and
61 <constant>GL_COLOR_INDEXES
</constant>
67 <term><parameter>params
</parameter></term>
70 Returns the requested data.
76 <refsect1 id=
"description"><title>Description
</title>
78 <function>glGetMaterial
</function> returns in
<parameter>params
</parameter> the value or values of parameter
<parameter>pname
</parameter>
79 of material
<parameter>face
</parameter>. Six parameters are defined:
83 <term><constant>GL_AMBIENT
</constant></term>
86 <parameter>params
</parameter> returns four integer or floating-point values representing the
87 ambient reflectance of the material.
90 are linearly mapped from the internal floating-point representation
91 such that
1.0 maps to the most positive representable integer value,
93 <inlineequation><mml:math>
96 </mml:math></inlineequation>
97 maps to the most negative representable integer value.
98 If the internal value is outside the range
99 <inlineequation><mml:math>
101 <mml:mfenced open=
"[" close=
"]">
105 </mml:math></inlineequation>,
106 the corresponding integer return value is undefined. The initial value is
112 <term><constant>GL_DIFFUSE
</constant></term>
115 <parameter>params
</parameter> returns four integer or floating-point values representing the
116 diffuse reflectance of the material.
119 are linearly mapped from the internal floating-point representation
120 such that
1.0 maps to the most positive representable integer value,
122 <inlineequation><mml:math>
124 <mml:mn>-
1.0</mml:mn>
125 </mml:math></inlineequation>
126 maps to the most negative representable integer value.
127 If the internal value is outside the range
128 <inlineequation><mml:math>
130 <mml:mfenced open=
"[" close=
"]">
134 </mml:math></inlineequation>,
135 the corresponding integer return value is undefined. The initial value is
136 (
0.8,
0.8,
0.8,
1.0).
141 <term><constant>GL_SPECULAR
</constant></term>
144 <parameter>params
</parameter> returns four integer or floating-point values representing the
145 specular reflectance of the material.
148 are linearly mapped from the internal floating-point representation
149 such that
1.0 maps to the most positive representable integer value,
151 <inlineequation><mml:math>
153 <mml:mn>-
1.0</mml:mn>
154 </mml:math></inlineequation>
155 maps to the most negative representable integer value.
156 If the internal value is outside the range
157 <inlineequation><mml:math>
159 <mml:mfenced open=
"[" close=
"]">
163 </mml:math></inlineequation>,
164 the corresponding integer return value is undefined. The initial value is
170 <term><constant>GL_EMISSION
</constant></term>
173 <parameter>params
</parameter> returns four integer or floating-point values representing the
174 emitted light intensity of the material.
177 are linearly mapped from the internal floating-point representation
178 such that
1.0 maps to the most positive representable integer value,
180 <inlineequation><mml:math>
182 <mml:mn>-
1.0</mml:mn>
183 </mml:math></inlineequation>
184 maps to the most negative representable integer value.
185 If the internal value is outside the range
186 <inlineequation><mml:math>
188 <mml:mfenced open=
"[" close=
"]">
192 </mml:math></inlineequation>,
193 the corresponding integer return value is undefined. The initial value is
199 <term><constant>GL_SHININESS
</constant></term>
202 <parameter>params
</parameter> returns one integer or floating-point value representing the
203 specular exponent of the material.
206 are computed by rounding the internal floating-point value to the
207 nearest integer value. The initial value is
0.
212 <term><constant>GL_COLOR_INDEXES
</constant></term>
215 <parameter>params
</parameter> returns three integer or floating-point values representing the
216 ambient, diffuse, and specular indices of the material.
217 These indices are used only for color index lighting.
218 (All the other parameters are used only for RGBA lighting.)
221 are computed by rounding the internal floating-point values to the
222 nearest integer values.
228 <refsect1 id=
"notes"><title>Notes
</title>
230 If an error is generated,
231 no change is made to the contents of
<parameter>params
</parameter>.
234 <refsect1 id=
"errors"><title>Errors
</title>
236 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>face
</parameter> or
<parameter>pname
</parameter> is not an
240 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glGetMaterial
</function>
241 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
242 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
245 <refsect1 id=
"seealso"><title>See Also
</title>
247 <citerefentry><refentrytitle>glMaterial
</refentrytitle></citerefentry>
250 <refsect1 id=
"Copyright"><title>Copyright
</title>
252 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
253 Silicon Graphics, Inc. This document is licensed under the SGI
254 Free Software B License. For details, see
255 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.