HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_OGLState.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RE_OGLState.h ( UI Library, C++)
7  *
8  * COMMENTS:
9  * The stored GL state for RE_OGLRender.
10  *
11  */
12 #ifndef RE_OGLState_h
13 #define RE_OGLState_h
14 
15 #include "RE_API.h"
16 #include "RE_Types.h"
17 #include "RE_TextureTypes.h"
18 #include "RE_Uniform.h"
19 
20 #include <UT/UT_Rect.h>
21 #include <UT/UT_Array.h>
22 #include <UT/UT_BitArray.h>
23 #include <UT/UT_IntArray.h>
24 
25 class RE_OGLFramebuffer;
26 class RE_OGLTexture;
27 class RE_Render;
28 class RE_Shader;
29 
31 {
32 public:
33  RE_OGLState();
34 
35  // clear all cached information without altering actual GL state
36  void invalidate();
37 
38 // State data
40 
41  // 0 = disabled, 1 = enabled, 3 = state is unknown
42  unsigned
43  myFillOffsetState : 2,
44  myLineOffsetState : 2,
45  myLineSmoothingState : 2,
46  myPointOffsetState : 2,
47  mySampleMaskState : 2,
48  myScissorState : 2,
49  myStencilState : 2,
50  mySeamlessMapState : 2;
51 
52  float wPosX, wPosY, wPosZ;
53  float rx, ry, rz;
54 
57 
60 
63 
64  float myXZoom, myYZoom;
65 
66  float zNear, zFar;
69 
72 
73  unsigned myColorMask;
74 
83 
84  // Stacks
89 
90  float lineWidthStack[PATTERN_STACK_SIZE];
92 
93  struct
94  {
95  float pointSize;
97  } pointSizeStack[PATTERN_STACK_SIZE];
99 
100  struct
101  {
102  unsigned char read:4,
103  write:4;
104  } myAlignmentStack[RE_ALIGN_STACK_SIZE];
106 
107  // These are the state caches for our mulitple texture units:
109  {
114 
116 
117  } myTexStack[RE_MAX_TEXTURE_STATE_STACK];
118 
120 
121  // smooth lines stack
124 
125  // stenciling stack
128 
129  // shader stack
132 
133  // depth stack
136 
137  // backface/winding stack
139 
140  unsigned myShaderStackValid : 1,
141  myFBOStackValid : 1;
142 
144 };
145 
146 #endif
float pointSize
Definition: RE_OGLState.h:95
#define RE_STENCIL_STACK_SIZE
Definition: RE_Types.h:938
UT_IntArray myBoundUniformBlocks
Definition: RE_OGLState.h:143
float zNear
Definition: RE_OGLState.h:66
#define RE_API
Definition: RE_API.h:10
int viewportStateValid
Definition: RE_OGLState.h:58
RE_ViewportCoordSpace scissorCoordSpace
Definition: RE_OGLState.h:62
int lineWidthIndex
Definition: RE_OGLState.h:91
int myDrawFBOStackIndex
Definition: RE_OGLState.h:86
UT_DimRect scissorState
Definition: RE_OGLState.h:55
UT_DimRect viewportState
Definition: RE_OGLState.h:56
int myReadFBOStackIndex
Definition: RE_OGLState.h:88
#define RE_DEPTH_STACK_SIZE
Definition: RE_Types.h:943
int scissorStateValid
Definition: RE_OGLState.h:59
bool programPointSize
Definition: RE_OGLState.h:96
RE_SFunction _s_function
Definition: RE_OGLState.h:77
int myShaderLevel
Definition: RE_OGLState.h:130
int _colorBufferWriting
Definition: RE_OGLState.h:39
unsigned char uint8
Definition: SYS_Types.h:36
float myYZoom
Definition: RE_OGLState.h:64
int _s_clear_value
Definition: RE_OGLState.h:75
UT_IntArray myBackfaceWinding
Definition: RE_OGLState.h:138
UT_Int32Array mySampleMask
Definition: RE_OGLState.h:70
RE_SOperation _s_operation_dpfail
Definition: RE_OGLState.h:81
unsigned int RE_TextureID
UT_BitArray mySampleMaskValid
Definition: RE_OGLState.h:71
#define RE_FRAMEBUFFER_STACK_SIZE
Definition: RE_Types.h:940
#define RE_MAX_TEXTURE_STATE_STACK
GLdouble GLdouble GLdouble GLdouble GLdouble zFar
Definition: glad.h:2817
RE_ViewportCoordSpace viewportCoordSpace
Definition: RE_OGLState.h:61
RE_ViewportCoordSpace
Definition: RE_Types.h:930
float wPosZ
Definition: RE_OGLState.h:52
#define PATTERN_STACK_SIZE
Definition: RE_Types.h:936
int myAlignmentStackIndex
Definition: RE_OGLState.h:105
int _s_function_ref
Definition: RE_OGLState.h:78
int _s_function_mask
Definition: RE_OGLState.h:79
unsigned myColorMask
Definition: RE_OGLState.h:73
RE_SOperation
Definition: RE_Types.h:502
int myStencilLevel
Definition: RE_OGLState.h:126
int myBlendSmoothLevel
Definition: RE_OGLState.h:122
#define RE_SHADER_STACK_SIZE
Definition: RE_Types.h:941
int _s_write_mask
Definition: RE_OGLState.h:76
float _offset_variable
Definition: RE_OGLState.h:67
int myTexStackIndex
Definition: RE_OGLState.h:119
RE_SOperation _s_operation_sfail
Definition: RE_OGLState.h:80
int myDepthLevel
Definition: RE_OGLState.h:134
RE_SOperation _s_operation_dppass
Definition: RE_OGLState.h:82
RE_SFunction
Definition: RE_Types.h:490
float _offset_constant
Definition: RE_OGLState.h:68
#define RE_SMOOTH_STACK_SIZE
Definition: RE_Types.h:937
#define RE_MAX_TEXTURES
int pointSizeIndex
Definition: RE_OGLState.h:98
#define RE_ALIGN_STACK_SIZE
Definition: RE_Types.h:939