[3597] | 1 | /* $Id: light.h,v 1.2 2000-05-23 20:34:51 jeroen Exp $ */
|
---|
[2938] | 2 |
|
---|
| 3 | /*
|
---|
| 4 | * Mesa 3-D graphics library
|
---|
[3597] | 5 | * Version: 3.3
|
---|
[2938] | 6 | *
|
---|
| 7 | * Copyright (C) 1999 Brian Paul All Rights Reserved.
|
---|
| 8 | *
|
---|
| 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:
|
---|
| 15 | *
|
---|
| 16 | * The above copyright notice and this permission notice shall be included
|
---|
| 17 | * in all copies or substantial portions of the Software.
|
---|
| 18 | *
|
---|
| 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.
|
---|
| 25 | */
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | #ifndef LIGHT_H
|
---|
| 32 | #define LIGHT_H
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | #include "types.h"
|
---|
| 36 |
|
---|
| 37 | struct gl_shine_tab {
|
---|
| 38 | struct gl_shine_tab *next, *prev;
|
---|
| 39 | GLfloat tab[SHINE_TABLE_SIZE+1];
|
---|
| 40 | GLfloat shininess;
|
---|
| 41 | GLuint refcount;
|
---|
| 42 | };
|
---|
| 43 |
|
---|
| 44 |
|
---|
[3597] | 45 | extern void
|
---|
| 46 | _mesa_ShadeModel( GLenum mode );
|
---|
[2938] | 47 |
|
---|
[3597] | 48 | extern void
|
---|
| 49 | _mesa_ColorMaterial( GLenum face, GLenum mode );
|
---|
[2938] | 50 |
|
---|
[3597] | 51 | extern void
|
---|
| 52 | _mesa_Lightf( GLenum light, GLenum pname, GLfloat param );
|
---|
[2938] | 53 |
|
---|
[3597] | 54 | extern void
|
---|
| 55 | _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params );
|
---|
[2938] | 56 |
|
---|
[3597] | 57 | extern void
|
---|
| 58 | _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params );
|
---|
[2938] | 59 |
|
---|
[3597] | 60 | extern void
|
---|
| 61 | _mesa_Lighti( GLenum light, GLenum pname, GLint param );
|
---|
[2938] | 62 |
|
---|
[3597] | 63 | extern void
|
---|
| 64 | _mesa_LightModelf( GLenum pname, GLfloat param );
|
---|
[2938] | 65 |
|
---|
[3597] | 66 | extern void
|
---|
| 67 | _mesa_LightModelfv( GLenum pname, const GLfloat *params );
|
---|
[2938] | 68 |
|
---|
[3597] | 69 | extern void
|
---|
| 70 | _mesa_LightModeli( GLenum pname, GLint param );
|
---|
[2938] | 71 |
|
---|
[3597] | 72 | extern void
|
---|
| 73 | _mesa_LightModeliv( GLenum pname, const GLint *params );
|
---|
[2938] | 74 |
|
---|
[3597] | 75 | extern void
|
---|
| 76 | _mesa_Materialf( GLenum face, GLenum pname, GLfloat param );
|
---|
[2938] | 77 |
|
---|
[3597] | 78 | extern void
|
---|
| 79 | _mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params );
|
---|
[2938] | 80 |
|
---|
[3597] | 81 | extern void
|
---|
| 82 | _mesa_Materiali( GLenum face, GLenum pname, GLint param );
|
---|
[2938] | 83 |
|
---|
[3597] | 84 | extern void
|
---|
| 85 | _mesa_Materialiv( GLenum face, GLenum pname, const GLint *params );
|
---|
[2938] | 86 |
|
---|
[3597] | 87 | extern void
|
---|
| 88 | _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params );
|
---|
[2938] | 89 |
|
---|
[3597] | 90 | extern void
|
---|
| 91 | _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params );
|
---|
[2938] | 92 |
|
---|
[3597] | 93 | extern void
|
---|
| 94 | _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
|
---|
| 95 |
|
---|
| 96 | extern void
|
---|
| 97 | _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params );
|
---|
| 98 |
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | extern GLuint gl_material_bitmask( GLcontext *ctx,
|
---|
| 102 | GLenum face, GLenum pname,
|
---|
| 103 | GLuint legal,
|
---|
| 104 | const char * );
|
---|
| 105 |
|
---|
| 106 | extern void gl_set_material( GLcontext *ctx, GLuint bitmask,
|
---|
| 107 | const GLfloat *params);
|
---|
| 108 |
|
---|
[2938] | 109 | extern void gl_compute_spot_exp_table( struct gl_light *l );
|
---|
| 110 |
|
---|
| 111 | extern void gl_compute_shine_table( GLcontext *ctx, GLuint i,
|
---|
[3597] | 112 | GLfloat shininess );
|
---|
[2938] | 113 |
|
---|
| 114 | extern void gl_update_lighting( GLcontext *ctx );
|
---|
| 115 |
|
---|
| 116 | extern void gl_compute_light_positions( GLcontext *ctx );
|
---|
| 117 |
|
---|
| 118 | extern void gl_update_normal_transform( GLcontext *ctx );
|
---|
| 119 |
|
---|
| 120 | extern void gl_update_material( GLcontext *ctx,
|
---|
[3597] | 121 | struct gl_material *m,
|
---|
| 122 | GLuint bitmask );
|
---|
[2938] | 123 |
|
---|
| 124 | extern void gl_update_color_material( GLcontext *ctx, const GLubyte rgba[4] );
|
---|
| 125 |
|
---|
| 126 |
|
---|
[3597] | 127 |
|
---|
| 128 |
|
---|
[2938] | 129 | #endif
|
---|
| 130 |
|
---|