Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glGetMaterial</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetMaterial"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetMaterial — return material parameters</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetMaterialfv</b>(</code></td><td>GLenum </td><td><var class="pdparam">face</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat * </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetMaterialiv</b>(</code></td><td>GLenum </td><td><var class="pdparam">face</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint * </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>face</code></em></span></dt><dd><p> | |
4 | Specifies which of the two materials is being queried. | |
5 | <code class="constant">GL_FRONT</code> or <code class="constant">GL_BACK</code> are accepted, | |
6 | representing the front and back materials, | |
7 | respectively. | |
8 | </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p> | |
9 | Specifies the material parameter to return. | |
10 | <code class="constant">GL_AMBIENT</code>, | |
11 | <code class="constant">GL_DIFFUSE</code>, | |
12 | <code class="constant">GL_SPECULAR</code>, | |
13 | <code class="constant">GL_EMISSION</code>, | |
14 | <code class="constant">GL_SHININESS</code>, and | |
15 | <code class="constant">GL_COLOR_INDEXES</code> | |
16 | are accepted. | |
17 | </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p> | |
18 | Returns the requested data. | |
19 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
20 | <code class="function">glGetMaterial</code> returns in <em class="parameter"><code>params</code></em> the value or values of parameter <em class="parameter"><code>pname</code></em> | |
21 | of material <em class="parameter"><code>face</code></em>. Six parameters are defined: | |
22 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_AMBIENT</code></span></dt><dd><p> | |
23 | <em class="parameter"><code>params</code></em> returns four integer or floating-point values representing the | |
24 | ambient reflectance of the material. | |
25 | Integer values, | |
26 | when requested, | |
27 | are linearly mapped from the internal floating-point representation | |
28 | such that 1.0 maps to the most positive representable integer value, | |
29 | and | |
30 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
31 | ||
32 | <mml:mn>-1.0</mml:mn> | |
33 | </mml:math> | |
34 | maps to the most negative representable integer value. | |
35 | If the internal value is outside the range | |
36 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
37 | ||
38 | <mml:mfenced open="[" close="]"> | |
39 | <mml:mn>-1</mml:mn> | |
40 | <mml:mn>1</mml:mn> | |
41 | </mml:mfenced> | |
42 | </mml:math>, | |
43 | the corresponding integer return value is undefined. The initial value is | |
44 | (0.2, 0.2, 0.2, 1.0) | |
45 | </p></dd><dt><span class="term"><code class="constant">GL_DIFFUSE</code></span></dt><dd><p> | |
46 | <em class="parameter"><code>params</code></em> returns four integer or floating-point values representing the | |
47 | diffuse reflectance of the material. | |
48 | Integer values, | |
49 | when requested, | |
50 | are linearly mapped from the internal floating-point representation | |
51 | such that 1.0 maps to the most positive representable integer value, | |
52 | and | |
53 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
54 | ||
55 | <mml:mn>-1.0</mml:mn> | |
56 | </mml:math> | |
57 | maps to the most negative representable integer value. | |
58 | If the internal value is outside the range | |
59 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
60 | ||
61 | <mml:mfenced open="[" close="]"> | |
62 | <mml:mn>-1</mml:mn> | |
63 | <mml:mn>1</mml:mn> | |
64 | </mml:mfenced> | |
65 | </mml:math>, | |
66 | the corresponding integer return value is undefined. The initial value is | |
67 | (0.8, 0.8, 0.8, 1.0). | |
68 | </p></dd><dt><span class="term"><code class="constant">GL_SPECULAR</code></span></dt><dd><p> | |
69 | <em class="parameter"><code>params</code></em> returns four integer or floating-point values representing the | |
70 | specular reflectance of the material. | |
71 | Integer values, | |
72 | when requested, | |
73 | are linearly mapped from the internal floating-point representation | |
74 | such that 1.0 maps to the most positive representable integer value, | |
75 | and | |
76 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
77 | ||
78 | <mml:mn>-1.0</mml:mn> | |
79 | </mml:math> | |
80 | maps to the most negative representable integer value. | |
81 | If the internal value is outside the range | |
82 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
83 | ||
84 | <mml:mfenced open="[" close="]"> | |
85 | <mml:mn>-1</mml:mn> | |
86 | <mml:mn>1</mml:mn> | |
87 | </mml:mfenced> | |
88 | </mml:math>, | |
89 | the corresponding integer return value is undefined. The initial value is | |
90 | (0, 0, 0, 1). | |
91 | </p></dd><dt><span class="term"><code class="constant">GL_EMISSION</code></span></dt><dd><p> | |
92 | <em class="parameter"><code>params</code></em> returns four integer or floating-point values representing the | |
93 | emitted light intensity of the material. | |
94 | Integer values, | |
95 | when requested, | |
96 | are linearly mapped from the internal floating-point representation | |
97 | such that 1.0 maps to the most positive representable integer value, | |
98 | and | |
99 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
100 | ||
101 | <mml:mn>-1.0</mml:mn> | |
102 | </mml:math> | |
103 | maps to the most negative representable integer value. | |
104 | If the internal value is outside the range | |
105 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
106 | ||
107 | <mml:mfenced open="[" close="]"> | |
108 | <mml:mn>-1</mml:mn> | |
109 | <mml:mn>1</mml:mn> | |
110 | </mml:mfenced> | |
111 | </mml:math>, | |
112 | the corresponding integer return value is undefined. The initial value is | |
113 | (0, 0, 0, 1). | |
114 | </p></dd><dt><span class="term"><code class="constant">GL_SHININESS</code></span></dt><dd><p> | |
115 | <em class="parameter"><code>params</code></em> returns one integer or floating-point value representing the | |
116 | specular exponent of the material. | |
117 | Integer values, | |
118 | when requested, | |
119 | are computed by rounding the internal floating-point value to the | |
120 | nearest integer value. The initial value is 0. | |
121 | </p></dd><dt><span class="term"><code class="constant">GL_COLOR_INDEXES</code></span></dt><dd><p> | |
122 | <em class="parameter"><code>params</code></em> returns three integer or floating-point values representing the | |
123 | ambient, diffuse, and specular indices of the material. | |
124 | These indices are used only for color index lighting. | |
125 | (All the other parameters are used only for RGBA lighting.) | |
126 | Integer values, | |
127 | when requested, | |
128 | are computed by rounding the internal floating-point values to the | |
129 | nearest integer values. | |
130 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
131 | If an error is generated, | |
132 | no change is made to the contents of <em class="parameter"><code>params</code></em>. | |
133 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
134 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>face</code></em> or <em class="parameter"><code>pname</code></em> is not an | |
135 | accepted value. | |
136 | </p><p> | |
137 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glGetMaterial</code> | |
138 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
139 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
140 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
141 | <a class="citerefentry" href="glMaterial.xml"><span class="citerefentry"><span class="refentrytitle">glMaterial</span></span></a> | |
142 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
143 | Copyright <span class="trademark"></span>© 1991-2006 | |
144 | Silicon Graphics, Inc. This document is licensed under the SGI | |
145 | Free Software B License. For details, see | |
146 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
147 | </p></div></div></body></html> |