/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 7.1
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "mtypes.h"
+/**
+ * Number of STATE_* values we need to address any GL state.
+ * Used to dimension arrays.
+ */
+#define STATE_LENGTH 5
+
+
/**
* Used for describing GL state referenced from inside ARB vertex and
* fragment programs.
* A string such as "state.light[0].ambient" gets translated into a
* sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
+ *
+ * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
+ * always be the array index.
*/
typedef enum gl_state_index_ {
STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
STATE_POINT_SIZE,
STATE_POINT_ATTENUATION,
- STATE_MATRIX,
- STATE_MODELVIEW,
- STATE_PROJECTION,
- STATE_MVP,
- STATE_TEXTURE,
- STATE_PROGRAM,
+ STATE_MODELVIEW_MATRIX,
+ STATE_PROJECTION_MATRIX,
+ STATE_MVP_MATRIX,
+ STATE_TEXTURE_MATRIX,
+ STATE_PROGRAM_MATRIX,
STATE_MATRIX_INVERSE,
STATE_MATRIX_TRANSPOSE,
STATE_MATRIX_INVTRANS,
STATE_SPECULAR,
STATE_EMISSION,
STATE_SHININESS,
- STATE_HALF,
+ STATE_HALF_VECTOR,
STATE_POSITION,
STATE_ATTENUATION,
STATE_SPOT_DIRECTION,
+ STATE_SPOT_CUTOFF,
STATE_TEXGEN_EYE_S,
STATE_TEXGEN_EYE_T,
STATE_NORMAL_SCALE,
STATE_TEXRECT_SCALE,
STATE_POSITION_NORMALIZED, /* normalized light position */
+ STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */
+ STATE_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */
STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
} gl_state_index;
extern GLbitfield
-_mesa_program_state_flags(const GLint state[]);
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
extern const char *
-_mesa_program_state_string(const GLint state[6]);
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
+
+
+extern void
+_mesa_load_tracked_matrices(GLcontext *ctx);
#endif /* PROG_STATEVARS_H */