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 
61  float myXZoom, myYZoom;
62 
63  float zNear, zFar;
66 
69 
70  unsigned myColorMask;
71 
80 
81  // Stacks
86 
87  float lineWidthStack[PATTERN_STACK_SIZE];
89 
90  struct
91  {
92  float pointSize;
94  } pointSizeStack[PATTERN_STACK_SIZE];
96 
97  struct
98  {
99  unsigned char read:4,
100  write:4;
101  } myAlignmentStack[RE_ALIGN_STACK_SIZE];
103 
104  // These are the state caches for our mulitple texture units:
106  {
111 
113 
114  } myTexStack[RE_MAX_TEXTURE_STATE_STACK];
115 
117 
118  // smooth lines stack
121 
122  // stenciling stack
125 
126  // shader stack
129 
130  // depth stack
133 
134  // backface/winding stack
136 
137  unsigned myShaderStackValid : 1,
138  myFBOStackValid : 1;
139 
141 };
142 
143 #endif
float pointSize
Definition: RE_OGLState.h:92
#define RE_STENCIL_STACK_SIZE
Definition: RE_Types.h:931
UT_IntArray myBoundUniformBlocks
Definition: RE_OGLState.h:140
float zNear
Definition: RE_OGLState.h:63
#define RE_API
Definition: RE_API.h:10
int viewportStateValid
Definition: RE_OGLState.h:58
int lineWidthIndex
Definition: RE_OGLState.h:88
int myDrawFBOStackIndex
Definition: RE_OGLState.h:83
UT_DimRect scissorState
Definition: RE_OGLState.h:55
UT_DimRect viewportState
Definition: RE_OGLState.h:56
int myReadFBOStackIndex
Definition: RE_OGLState.h:85
#define RE_DEPTH_STACK_SIZE
Definition: RE_Types.h:936
int scissorStateValid
Definition: RE_OGLState.h:59
bool programPointSize
Definition: RE_OGLState.h:93
RE_SFunction _s_function
Definition: RE_OGLState.h:74
int myShaderLevel
Definition: RE_OGLState.h:127
int _colorBufferWriting
Definition: RE_OGLState.h:39
unsigned char uint8
Definition: SYS_Types.h:36
float myYZoom
Definition: RE_OGLState.h:61
int _s_clear_value
Definition: RE_OGLState.h:72
UT_IntArray myBackfaceWinding
Definition: RE_OGLState.h:135
UT_Int32Array mySampleMask
Definition: RE_OGLState.h:67
RE_SOperation _s_operation_dpfail
Definition: RE_OGLState.h:78
unsigned int RE_TextureID
UT_BitArray mySampleMaskValid
Definition: RE_OGLState.h:68
#define RE_FRAMEBUFFER_STACK_SIZE
Definition: RE_Types.h:933
#define RE_MAX_TEXTURE_STATE_STACK
GLdouble GLdouble GLdouble GLdouble GLdouble zFar
Definition: glad.h:2817
float wPosZ
Definition: RE_OGLState.h:52
#define PATTERN_STACK_SIZE
Definition: RE_Types.h:929
int myAlignmentStackIndex
Definition: RE_OGLState.h:102
int _s_function_ref
Definition: RE_OGLState.h:75
int _s_function_mask
Definition: RE_OGLState.h:76
unsigned myColorMask
Definition: RE_OGLState.h:70
RE_SOperation
Definition: RE_Types.h:502
int myStencilLevel
Definition: RE_OGLState.h:123
int myBlendSmoothLevel
Definition: RE_OGLState.h:119
#define RE_SHADER_STACK_SIZE
Definition: RE_Types.h:934
int _s_write_mask
Definition: RE_OGLState.h:73
float _offset_variable
Definition: RE_OGLState.h:64
int myTexStackIndex
Definition: RE_OGLState.h:116
RE_SOperation _s_operation_sfail
Definition: RE_OGLState.h:77
int myDepthLevel
Definition: RE_OGLState.h:131
RE_SOperation _s_operation_dppass
Definition: RE_OGLState.h:79
RE_SFunction
Definition: RE_Types.h:490
float _offset_constant
Definition: RE_OGLState.h:65
#define RE_SMOOTH_STACK_SIZE
Definition: RE_Types.h:930
#define RE_MAX_TEXTURES
int pointSizeIndex
Definition: RE_OGLState.h:95
#define RE_ALIGN_STACK_SIZE
Definition: RE_Types.h:932