1 /* $Id: light.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 struct gl_shine_tab
*next
, *prev
;
36 GLfloat tab
[SHINE_TABLE_SIZE
+1];
43 _mesa_ShadeModel( GLenum mode
);
46 _mesa_ColorMaterial( GLenum face
, GLenum mode
);
49 _mesa_Lightf( GLenum light
, GLenum pname
, GLfloat param
);
52 _mesa_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
);
55 _mesa_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
);
58 _mesa_Lighti( GLenum light
, GLenum pname
, GLint param
);
61 _mesa_LightModelf( GLenum pname
, GLfloat param
);
64 _mesa_LightModelfv( GLenum pname
, const GLfloat
*params
);
67 _mesa_LightModeli( GLenum pname
, GLint param
);
70 _mesa_LightModeliv( GLenum pname
, const GLint
*params
);
73 _mesa_Materialf( GLenum face
, GLenum pname
, GLfloat param
);
76 _mesa_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*params
);
79 _mesa_Materiali( GLenum face
, GLenum pname
, GLint param
);
82 _mesa_Materialiv( GLenum face
, GLenum pname
, const GLint
*params
);
85 _mesa_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
);
88 _mesa_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
);
91 _mesa_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
);
94 _mesa_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
);
98 extern GLuint
gl_material_bitmask( GLcontext
*ctx
,
99 GLenum face
, GLenum pname
,
103 extern void gl_set_material( GLcontext
*ctx
, GLuint bitmask
,
104 const GLfloat
*params
);
106 extern void gl_compute_spot_exp_table( struct gl_light
*l
);
108 extern void gl_compute_shine_table( GLcontext
*ctx
, GLuint i
,
111 extern void gl_update_lighting( GLcontext
*ctx
);
113 extern void gl_compute_light_positions( GLcontext
*ctx
);
115 extern void gl_update_normal_transform( GLcontext
*ctx
);
117 extern void gl_update_material( GLcontext
*ctx
,
118 struct gl_material
*m
,
121 extern void gl_update_color_material( GLcontext
*ctx
, const GLubyte rgba
[4] );