| 1 | /* $Id: light.h,v 1.1 2000-02-29 00:48:32 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Mesa 3-D graphics library
|
|---|
| 5 | * Version: 3.1
|
|---|
| 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 |
|
|---|
| 45 | extern void gl_ShadeModel( GLcontext *ctx, GLenum mode );
|
|---|
| 46 |
|
|---|
| 47 | extern void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode );
|
|---|
| 48 |
|
|---|
| 49 | extern void gl_Lightfv( GLcontext *ctx,
|
|---|
| 50 | GLenum light, GLenum pname, const GLfloat *params,
|
|---|
| 51 | GLint nparams );
|
|---|
| 52 |
|
|---|
| 53 | extern void gl_LightModelfv( GLcontext *ctx,
|
|---|
| 54 | GLenum pname, const GLfloat *params );
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | extern GLuint gl_material_bitmask( GLcontext *ctx,
|
|---|
| 58 | GLenum face, GLenum pname,
|
|---|
| 59 | GLuint legal,
|
|---|
| 60 | const char * );
|
|---|
| 61 |
|
|---|
| 62 | extern void gl_set_material( GLcontext *ctx, GLuint bitmask,
|
|---|
| 63 | const GLfloat *params);
|
|---|
| 64 |
|
|---|
| 65 | extern void gl_Materialfv( GLcontext *ctx,
|
|---|
| 66 | GLenum face, GLenum pname, const GLfloat *params );
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | extern void gl_GetLightfv( GLcontext *ctx,
|
|---|
| 71 | GLenum light, GLenum pname, GLfloat *params );
|
|---|
| 72 |
|
|---|
| 73 | extern void gl_GetLightiv( GLcontext *ctx,
|
|---|
| 74 | GLenum light, GLenum pname, GLint *params );
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | extern void gl_GetMaterialfv( GLcontext *ctx,
|
|---|
| 78 | GLenum face, GLenum pname, GLfloat *params );
|
|---|
| 79 |
|
|---|
| 80 | extern void gl_GetMaterialiv( GLcontext *ctx,
|
|---|
| 81 | GLenum face, GLenum pname, GLint *params );
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | extern void gl_compute_spot_exp_table( struct gl_light *l );
|
|---|
| 85 |
|
|---|
| 86 | extern void gl_compute_shine_table( GLcontext *ctx, GLuint i,
|
|---|
| 87 | GLfloat shininess );
|
|---|
| 88 |
|
|---|
| 89 | extern void gl_update_lighting( GLcontext *ctx );
|
|---|
| 90 |
|
|---|
| 91 | extern void gl_compute_light_positions( GLcontext *ctx );
|
|---|
| 92 |
|
|---|
| 93 | extern void gl_update_normal_transform( GLcontext *ctx );
|
|---|
| 94 |
|
|---|
| 95 | extern void gl_update_material( GLcontext *ctx,
|
|---|
| 96 | struct gl_material *m,
|
|---|
| 97 | GLuint bitmask );
|
|---|
| 98 |
|
|---|
| 99 | extern void gl_update_color_material( GLcontext *ctx, const GLubyte rgba[4] );
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 | #endif
|
|---|
| 103 |
|
|---|