HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  ~RE_OGLState();
35 
36  // clear all cached information without altering actual GL state
37  void invalidate();
38 
39 // State data
41 
42  // 0 = disabled, 1 = enabled, 3 = state is unknown
43  unsigned
44  myFillOffsetState : 2,
45  myLineOffsetState : 2,
46  myLineSmoothingState : 2,
47  myPointOffsetState : 2,
48  mySampleMaskState : 2,
49  myScissorState : 2,
50  myStencilState : 2,
51  mySeamlessMapState : 2;
52 
53  float wPosX, wPosY, wPosZ;
54  float rx, ry, rz;
55 
58 
61 
62  float myXZoom, myYZoom;
63 
64  float zNear, zFar;
67 
70 
71  unsigned myColorMask;
72 
81 
82  // Stacks
87 
88  float lineWidthStack[PATTERN_STACK_SIZE];
90 
91  struct
92  {
93  float pointSize;
95  } pointSizeStack[PATTERN_STACK_SIZE];
97 
98  struct
99  {
100  unsigned char read:4,
101  write:4;
102  } myAlignmentStack[RE_ALIGN_STACK_SIZE];
104 
105  // These are the state caches for our mulitple texture units:
107  {
112 
114 
115  } myTexStack[RE_MAX_TEXTURE_STATE_STACK];
116 
118 
119  // smooth lines stack
122 
123  // stenciling stack
126 
127  // shader stack
130 
131  // depth stack
134 
135  // backface/winding stack
137 
138  unsigned myShaderStackValid : 1,
139  myFBOStackValid : 1;
140 
142 };
143 
144 #endif
float pointSize
Definition: RE_OGLState.h:93
#define RE_STENCIL_STACK_SIZE
Definition: RE_Types.h:843
UT_IntArray myBoundUniformBlocks
Definition: RE_OGLState.h:141
float zNear
Definition: RE_OGLState.h:64
#define RE_API
Definition: RE_API.h:10
int viewportStateValid
Definition: RE_OGLState.h:59
int lineWidthIndex
Definition: RE_OGLState.h:89
int myDrawFBOStackIndex
Definition: RE_OGLState.h:84
void read(T &in, bool &v)
Definition: ImfXdr.h:611
UT_DimRect scissorState
Definition: RE_OGLState.h:56
UT_DimRect viewportState
Definition: RE_OGLState.h:57
int myReadFBOStackIndex
Definition: RE_OGLState.h:86
#define RE_DEPTH_STACK_SIZE
Definition: RE_Types.h:848
int scissorStateValid
Definition: RE_OGLState.h:60
bool programPointSize
Definition: RE_OGLState.h:94
RE_SFunction _s_function
Definition: RE_OGLState.h:75
int myShaderLevel
Definition: RE_OGLState.h:128
int _colorBufferWriting
Definition: RE_OGLState.h:40
float myYZoom
Definition: RE_OGLState.h:62
int _s_clear_value
Definition: RE_OGLState.h:73
UT_IntArray myBackfaceWinding
Definition: RE_OGLState.h:136
UT_Int32Array mySampleMask
Definition: RE_OGLState.h:68
RE_SOperation _s_operation_dpfail
Definition: RE_OGLState.h:79
UT_BitArray mySampleMaskValid
Definition: RE_OGLState.h:69
#define RE_FRAMEBUFFER_STACK_SIZE
Definition: RE_Types.h:845
#define RE_MAX_TEXTURE_STATE_STACK
float wPosZ
Definition: RE_OGLState.h:53
#define PATTERN_STACK_SIZE
Definition: RE_Types.h:841
int myAlignmentStackIndex
Definition: RE_OGLState.h:103
int _s_function_ref
Definition: RE_OGLState.h:76
int _s_function_mask
Definition: RE_OGLState.h:77
unsigned myColorMask
Definition: RE_OGLState.h:71
unsigned char uint8
Definition: SYS_Types.h:25
RE_SOperation
Definition: RE_Types.h:464
int myStencilLevel
Definition: RE_OGLState.h:124
int myBlendSmoothLevel
Definition: RE_OGLState.h:120
#define RE_SHADER_STACK_SIZE
Definition: RE_Types.h:846
int _s_write_mask
Definition: RE_OGLState.h:74
float _offset_variable
Definition: RE_OGLState.h:65
int myTexStackIndex
Definition: RE_OGLState.h:117
RE_SOperation _s_operation_sfail
Definition: RE_OGLState.h:78
void write(T &out, bool v)
Definition: ImfXdr.h:332
int myDepthLevel
Definition: RE_OGLState.h:132
RE_SOperation _s_operation_dppass
Definition: RE_OGLState.h:80
RE_SFunction
Definition: RE_Types.h:452
float _offset_constant
Definition: RE_OGLState.h:66
#define RE_SMOOTH_STACK_SIZE
Definition: RE_Types.h:842
#define RE_MAX_TEXTURES
int pointSizeIndex
Definition: RE_OGLState.h:96
#define RE_ALIGN_STACK_SIZE
Definition: RE_Types.h:844