1GLGETMATERIAL(3G)                                            GLGETMATERIAL(3G)
2
3
4

NAME

6       glGetMaterialfv, glGetMaterialiv - return material parameters
7
8

C SPECIFICATION

10       void glGetMaterialfv( GLenum face,
11                             GLenum pname,
12                             GLfloat *params )
13       void glGetMaterialiv( GLenum face,
14                             GLenum pname,
15                             GLint *params )
16
17

PARAMETERS

19       face    Specifies   which  of  the  two  materials  is  being  queried.
20               GL_FRONT or GL_BACK are accepted, representing  the  front  and
21               back materials, respectively.
22
23       pname   Specifies   the  material  parameter  to  return.   GL_AMBIENT,
24               GL_DIFFUSE,   GL_SPECULAR,   GL_EMISSION,   GL_SHININESS,   and
25               GL_COLOR_INDEXES are accepted.
26
27       params  Returns the requested data.
28

DESCRIPTION

30       glGetMaterial  returns in params the value or values of parameter pname
31       of material face. Six parameters are defined:
32
33       GL_AMBIENT            params returns  four  integer  or  floating-point
34                             values  representing  the  ambient reflectance of
35                             the material.  Integer  values,  when  requested,
36                             are  linearly  mapped from the internal floating-
37                             point representation such that 1.0  maps  to  the
38                             most  positive  representable  integer value, and
39                             -1.0 maps  to  the  most  negative  representable
40                             integer  value.  If the internal value is outside
41                             the range  [-1,  1],  the  corresponding  integer
42                             return  value  is undefined. The initial value is
43                             (0.2, 0.2, 0.2, 1.0)
44
45       GL_DIFFUSE            params returns  four  integer  or  floating-point
46                             values  representing  the  diffuse reflectance of
47                             the material.  Integer  values,  when  requested,
48                             are  linearly  mapped from the internal floating-
49                             point representation such that 1.0  maps  to  the
50                             most  positive  representable  integer value, and
51                             -1.0 maps  to  the  most  negative  representable
52                             integer  value.  If the internal value is outside
53                             the range  [-1,  1],  the  corresponding  integer
54                             return  value  is undefined. The initial value is
55                             (0.8, 0.8, 0.8, 1.0).
56
57       GL_SPECULAR           params returns  four  integer  or  floating-point
58                             values  representing  the specular reflectance of
59                             the material.  Integer  values,  when  requested,
60                             are  linearly  mapped from the internal floating-
61                             point representation such that 1.0  maps  to  the
62                             most  positive  representable  integer value, and
63                             -1.0 maps  to  the  most  negative  representable
64                             integer  value.  If the internal value is outside
65                             the range  [-1,  1],  the  corresponding  integer
66                             return  value  is undefined. The initial value is
67                             (0, 0, 0, 1).
68
69       GL_EMISSION           params returns  four  integer  or  floating-point
70                             values  representing  the emitted light intensity
71                             of the material.  Integer values, when requested,
72                             are  linearly  mapped from the internal floating-
73                             point representation such that 1.0  maps  to  the
74                             most  positive  representable  integer value, and
75                             -1.0 maps  to  the  most  negative  representable
76                             integer  value.  If the internal value is outside
77                             the range [-1, 1.0],  the  corresponding  integer
78                             return  value  is undefined. The initial value is
79                             (0, 0, 0, 1).
80
81       GL_SHININESS          params  returns  one  integer  or  floating-point
82                             value  representing  the specular exponent of the
83                             material.  Integer values,  when  requested,  are
84                             computed  by rounding the internal floating-point
85                             value to the nearest integer value.  The  initial
86                             value is 0.
87
88       GL_COLOR_INDEXES      params  returns  three  integer or floating-point
89                             values representing  the  ambient,  diffuse,  and
90                             specular  indices of the material.  These indices
91                             are used only for color index lighting.  (All the
92                             other  parameters  are  used only for RGBA light‐
93                             ing.)  Integer values, when requested,  are  com‐
94                             puted  by  rounding  the  internal floating-point
95                             values to the nearest integer values.
96

NOTES

98       If an error is generated, no change is made to the contents of params.
99

ERRORS

101       GL_INVALID_ENUM is generated if face or pname is not an accepted value.
102
103       GL_INVALID_OPERATION is generated if glGetMaterial is executed  between
104       the execution of glBegin and the corresponding execution of glEnd.
105

SEE ALSO

107       glMaterial(3G)
108
109
110
111                                                             GLGETMATERIAL(3G)
Impressum