1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved.
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef CR_STATE_CURRENT_H
|
---|
8 | #define CR_STATE_CURRENT_H
|
---|
9 |
|
---|
10 | #include "state/cr_currentpointers.h"
|
---|
11 |
|
---|
12 | #include <iprt/cdefs.h>
|
---|
13 |
|
---|
14 | #ifdef __cplusplus
|
---|
15 | extern "C" {
|
---|
16 | #endif
|
---|
17 |
|
---|
18 |
|
---|
19 | #define VERT_ATTRIB_POS 0
|
---|
20 | #define VERT_ATTRIB_WEIGHT 1
|
---|
21 | #define VERT_ATTRIB_NORMAL 2
|
---|
22 | #define VERT_ATTRIB_COLOR0 3
|
---|
23 | #define VERT_ATTRIB_COLOR1 4
|
---|
24 | #define VERT_ATTRIB_FOG 5
|
---|
25 | #define VERT_ATTRIB_SIX 6
|
---|
26 | #define VERT_ATTRIB_SEVEN 7
|
---|
27 | #define VERT_ATTRIB_TEX0 8
|
---|
28 | #define VERT_ATTRIB_TEX1 9
|
---|
29 | #define VERT_ATTRIB_TEX2 10
|
---|
30 | #define VERT_ATTRIB_TEX3 11
|
---|
31 | #define VERT_ATTRIB_TEX4 12
|
---|
32 | #define VERT_ATTRIB_TEX5 13
|
---|
33 | #define VERT_ATTRIB_TEX6 14
|
---|
34 | #define VERT_ATTRIB_TEX7 15
|
---|
35 | #define VERT_ATTRIB_MAX 16
|
---|
36 |
|
---|
37 |
|
---|
38 | typedef struct {
|
---|
39 | CRbitvalue dirty[CR_MAX_BITARRAY];
|
---|
40 | /* Regardless of NV_vertex_program, we use this array */
|
---|
41 | CRbitvalue vertexAttrib[CR_MAX_VERTEX_ATTRIBS][CR_MAX_BITARRAY];
|
---|
42 | CRbitvalue edgeFlag[CR_MAX_BITARRAY];
|
---|
43 | CRbitvalue colorIndex[CR_MAX_BITARRAY];
|
---|
44 | CRbitvalue rasterPos[CR_MAX_BITARRAY];
|
---|
45 | } CRCurrentBits;
|
---|
46 |
|
---|
47 |
|
---|
48 | typedef struct {
|
---|
49 | /* Pre-transform values */
|
---|
50 | /* Regardless of NV_vertex_program, we use this array */
|
---|
51 | GLfloat attrib[CR_MAX_VERTEX_ATTRIBS][4];
|
---|
52 | GLboolean edgeFlag;
|
---|
53 | GLfloat colorIndex;
|
---|
54 | /* Post-transform values */
|
---|
55 | GLvectorf eyePos;
|
---|
56 | GLvectorf clipPos;
|
---|
57 | GLvectorf winPos;
|
---|
58 | } CRVertex;
|
---|
59 |
|
---|
60 |
|
---|
61 | typedef struct {
|
---|
62 | /* Regardless of NV_vertex_program, we use this array */
|
---|
63 | GLfloat vertexAttrib[CR_MAX_VERTEX_ATTRIBS][4];
|
---|
64 | GLfloat vertexAttribPre[CR_MAX_VERTEX_ATTRIBS][4];
|
---|
65 |
|
---|
66 | CRCurrentStatePointers *current;
|
---|
67 |
|
---|
68 | GLboolean rasterValid;
|
---|
69 | GLfloat rasterAttrib[CR_MAX_VERTEX_ATTRIBS][4];
|
---|
70 | GLfloat rasterAttribPre[CR_MAX_VERTEX_ATTRIBS][4];
|
---|
71 |
|
---|
72 | GLdouble rasterIndex;
|
---|
73 | GLboolean edgeFlag;
|
---|
74 | GLboolean edgeFlagPre;
|
---|
75 | GLfloat colorIndex;
|
---|
76 | GLfloat colorIndexPre;
|
---|
77 |
|
---|
78 | /* XXX this isn't really "current" state - move someday */
|
---|
79 | GLuint attribsUsedMask; /* for ARB_vertex_program */
|
---|
80 | GLboolean inBeginEnd;
|
---|
81 | GLenum mode;
|
---|
82 | GLuint beginEndMax;
|
---|
83 | GLuint beginEndNum;
|
---|
84 | GLuint flushOnEnd;
|
---|
85 |
|
---|
86 | } CRCurrentState;
|
---|
87 |
|
---|
88 | DECLEXPORT(void) crStateCurrentInit( CRContext *ctx );
|
---|
89 |
|
---|
90 | DECLEXPORT(void) crStateCurrentRecover( void );
|
---|
91 |
|
---|
92 | DECLEXPORT(void) crStateCurrentDiff(CRCurrentBits *bb, CRbitvalue *bitID,
|
---|
93 | CRContext *fromCtx, CRContext *toCtx);
|
---|
94 | DECLEXPORT(void) crStateCurrentSwitch(CRCurrentBits *bb, CRbitvalue *bitID,
|
---|
95 | CRContext *fromCtx, CRContext *toCtx);
|
---|
96 |
|
---|
97 | DECLEXPORT(void) crStateRasterPosUpdate(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
---|
98 |
|
---|
99 | #ifdef __cplusplus
|
---|
100 | }
|
---|
101 | #endif
|
---|
102 |
|
---|
103 | #endif /* CR_STATE_CURRENT_H */
|
---|