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_BUFFER_H
|
---|
8 | #define CR_STATE_BUFFER_H
|
---|
9 |
|
---|
10 | #include "state/cr_statetypes.h"
|
---|
11 |
|
---|
12 | #include <iprt/cdefs.h>
|
---|
13 |
|
---|
14 | #ifdef __cplusplus
|
---|
15 | extern "C" {
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | typedef struct {
|
---|
19 | CRbitvalue dirty[CR_MAX_BITARRAY];
|
---|
20 | CRbitvalue enable[CR_MAX_BITARRAY];
|
---|
21 | CRbitvalue alphaFunc[CR_MAX_BITARRAY];
|
---|
22 | CRbitvalue depthFunc[CR_MAX_BITARRAY];
|
---|
23 | CRbitvalue blendFunc[CR_MAX_BITARRAY];
|
---|
24 | CRbitvalue logicOp[CR_MAX_BITARRAY];
|
---|
25 | CRbitvalue indexLogicOp[CR_MAX_BITARRAY];
|
---|
26 | CRbitvalue drawBuffer[CR_MAX_BITARRAY];
|
---|
27 | CRbitvalue readBuffer[CR_MAX_BITARRAY];
|
---|
28 | CRbitvalue indexMask[CR_MAX_BITARRAY];
|
---|
29 | CRbitvalue colorWriteMask[CR_MAX_BITARRAY];
|
---|
30 | CRbitvalue clearColor[CR_MAX_BITARRAY];
|
---|
31 | CRbitvalue clearIndex[CR_MAX_BITARRAY];
|
---|
32 | CRbitvalue clearDepth[CR_MAX_BITARRAY];
|
---|
33 | CRbitvalue clearAccum[CR_MAX_BITARRAY];
|
---|
34 | CRbitvalue depthMask[CR_MAX_BITARRAY];
|
---|
35 | #ifdef CR_EXT_blend_color
|
---|
36 | CRbitvalue blendColor[CR_MAX_BITARRAY];
|
---|
37 | #endif
|
---|
38 | #if defined(CR_EXT_blend_minmax) || defined(CR_EXT_blend_subtract) || defined(CR_EXT_blend_logic_op)
|
---|
39 | CRbitvalue blendEquation[CR_MAX_BITARRAY];
|
---|
40 | #endif
|
---|
41 | #if defined(CR_EXT_blend_func_separate)
|
---|
42 | CRbitvalue blendFuncSeparate[CR_MAX_BITARRAY];
|
---|
43 | #endif
|
---|
44 | } CRBufferBits;
|
---|
45 |
|
---|
46 | typedef struct {
|
---|
47 | GLboolean depthTest;
|
---|
48 | GLboolean blend;
|
---|
49 | GLboolean alphaTest;
|
---|
50 | GLboolean logicOp;
|
---|
51 | GLboolean indexLogicOp;
|
---|
52 | GLboolean dither;
|
---|
53 | GLboolean depthMask;
|
---|
54 |
|
---|
55 | GLenum alphaTestFunc;
|
---|
56 | GLfloat alphaTestRef;
|
---|
57 | GLenum depthFunc;
|
---|
58 | GLenum blendSrcRGB;
|
---|
59 | GLenum blendDstRGB;
|
---|
60 | GLenum blendSrcA;
|
---|
61 | GLenum blendDstA;
|
---|
62 | GLenum logicOpMode;
|
---|
63 | GLenum drawBuffer;
|
---|
64 | GLenum readBuffer;
|
---|
65 | GLint indexWriteMask;
|
---|
66 | GLcolorb colorWriteMask;
|
---|
67 | GLcolorf colorClearValue;
|
---|
68 | GLfloat indexClearValue;
|
---|
69 | GLdefault depthClearValue;
|
---|
70 | GLcolorf accumClearValue;
|
---|
71 | #ifdef CR_EXT_blend_color
|
---|
72 | GLcolorf blendColor;
|
---|
73 | #endif
|
---|
74 | #if defined(CR_EXT_blend_minmax) || defined(CR_EXT_blend_subtract)
|
---|
75 | GLenum blendEquation;
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | GLint width, height;
|
---|
79 | GLint storedWidth, storedHeight;
|
---|
80 | GLvoid *pFrontImg;
|
---|
81 | GLvoid *pBackImg;
|
---|
82 | } CRBufferState;
|
---|
83 |
|
---|
84 | DECLEXPORT(void) crStateBufferInit(CRContext *ctx);
|
---|
85 |
|
---|
86 | DECLEXPORT(void) crStateBufferDiff(CRBufferBits *bb, CRbitvalue *bitID,
|
---|
87 | CRContext *fromCtx, CRContext *toCtx);
|
---|
88 | DECLEXPORT(void) crStateBufferSwitch(CRBufferBits *bb, CRbitvalue *bitID,
|
---|
89 | CRContext *fromCtx, CRContext *toCtx);
|
---|
90 |
|
---|
91 | #ifdef __cplusplus
|
---|
92 | }
|
---|
93 | #endif
|
---|
94 |
|
---|
95 | #endif /* CR_STATE_BUFFER_H */
|
---|