blob: 1b686d8078cac65691887e0e0746435c80f2017c [file] [log] [blame]
Brian00cdc0a2006-12-14 15:01:06 -07001/*
2 * Mesa 3-D graphics library
3 * Version: 6.5.2
4 *
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef PROG_STATEVARS_H
26#define PROG_STATEVARS_H
27
28#include "mtypes.h"
29
30
31/**
Brianb7978af2007-01-09 19:17:17 -070032 * Number of STATE_* values we need to address any GL state.
33 * Used to dimension arrays.
34 */
35#define STATE_LENGTH 6
36
37
38/**
Brian00cdc0a2006-12-14 15:01:06 -070039 * Used for describing GL state referenced from inside ARB vertex and
40 * fragment programs.
41 * A string such as "state.light[0].ambient" gets translated into a
42 * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
Brian65319522007-02-21 11:08:21 -070043 *
44 * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
45 * always be the array index.
Brian00cdc0a2006-12-14 15:01:06 -070046 */
47typedef enum gl_state_index_ {
48 STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
49
50 STATE_LIGHT,
51 STATE_LIGHTMODEL_AMBIENT,
52 STATE_LIGHTMODEL_SCENECOLOR,
53 STATE_LIGHTPROD,
54
55 STATE_TEXGEN,
56
Brian65319522007-02-21 11:08:21 -070057 STATE_FOG,
Brian00cdc0a2006-12-14 15:01:06 -070058 STATE_FOG_COLOR,
59 STATE_FOG_PARAMS,
60
61 STATE_CLIPPLANE,
62
63 STATE_POINT_SIZE,
64 STATE_POINT_ATTENUATION,
65
Brian65319522007-02-21 11:08:21 -070066 STATE_MODELVIEW_MATRIX,
67 STATE_PROJECTION_MATRIX,
68 STATE_MVP_MATRIX,
69 STATE_TEXTURE_MATRIX,
70 STATE_PROGRAM_MATRIX,
Brian00cdc0a2006-12-14 15:01:06 -070071 STATE_MATRIX_INVERSE,
72 STATE_MATRIX_TRANSPOSE,
73 STATE_MATRIX_INVTRANS,
74
75 STATE_AMBIENT,
76 STATE_DIFFUSE,
77 STATE_SPECULAR,
78 STATE_EMISSION,
79 STATE_SHININESS,
80 STATE_HALF,
81
82 STATE_POSITION,
83 STATE_ATTENUATION,
84 STATE_SPOT_DIRECTION,
85
86 STATE_TEXGEN_EYE_S,
87 STATE_TEXGEN_EYE_T,
88 STATE_TEXGEN_EYE_R,
89 STATE_TEXGEN_EYE_Q,
90 STATE_TEXGEN_OBJECT_S,
91 STATE_TEXGEN_OBJECT_T,
92 STATE_TEXGEN_OBJECT_R,
93 STATE_TEXGEN_OBJECT_Q,
94
95 STATE_TEXENV_COLOR,
96
97 STATE_DEPTH_RANGE,
98
99 STATE_VERTEX_PROGRAM,
100 STATE_FRAGMENT_PROGRAM,
101
102 STATE_ENV,
103 STATE_LOCAL,
104
105 STATE_INTERNAL, /* Mesa additions */
106 STATE_NORMAL_SCALE,
107 STATE_TEXRECT_SCALE,
108 STATE_POSITION_NORMALIZED, /* normalized light position */
Brian00cdc0a2006-12-14 15:01:06 -0700109 STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
110} gl_state_index;
111
112
113
114extern void
115_mesa_load_state_parameters(GLcontext *ctx,
116 struct gl_program_parameter_list *paramList);
117
118
119extern GLbitfield
Brianb7978af2007-01-09 19:17:17 -0700120_mesa_program_state_flags(const GLint state[STATE_LENGTH]);
Brian00cdc0a2006-12-14 15:01:06 -0700121
122
123extern const char *
Brianb7978af2007-01-09 19:17:17 -0700124_mesa_program_state_string(const GLint state[STATE_LENGTH]);
Brian00cdc0a2006-12-14 15:01:06 -0700125
126
127#endif /* PROG_STATEVARS_H */