Line | |
---|
1 | #ifndef __RENDERSTATE_H
|
---|
2 | #define __RENDERSTATE_H
|
---|
3 |
|
---|
4 |
|
---|
5 | #include "common.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace CHCDemo
|
---|
9 | {
|
---|
10 |
|
---|
11 | /** The current render state.
|
---|
12 | */
|
---|
13 | class RenderState
|
---|
14 | {
|
---|
15 | public:
|
---|
16 |
|
---|
17 | enum Mode
|
---|
18 | {
|
---|
19 | QUERY,
|
---|
20 | RENDER
|
---|
21 | };
|
---|
22 |
|
---|
23 | /** Constructor setting render as default state.
|
---|
24 | */
|
---|
25 | RenderState();
|
---|
26 |
|
---|
27 | ~RenderState() { Reset(); };
|
---|
28 |
|
---|
29 | /** This must be called each time before and after an occlusion test.
|
---|
30 | Mode is one of render mode or query mode. Returns true if a state
|
---|
31 | change was issued.
|
---|
32 | */
|
---|
33 | bool SetState(Mode mode);
|
---|
34 | /** Sets the current render state.
|
---|
35 | */
|
---|
36 | void SetState(bool texturing, bool alphaTest);
|
---|
37 | /** Returns wether we are in query or render mode
|
---|
38 | */
|
---|
39 | inline Mode GetMode() const { return mMode; }
|
---|
40 | /** Reset the state.
|
---|
41 | */
|
---|
42 | void Reset();
|
---|
43 |
|
---|
44 | protected:
|
---|
45 |
|
---|
46 | bool mAlphaTestEnabled;
|
---|
47 | bool mTexturesEnabled;
|
---|
48 |
|
---|
49 | Mode mMode;
|
---|
50 | };
|
---|
51 |
|
---|
52 |
|
---|
53 | }
|
---|
54 |
|
---|
55 | #endif // __RENDERSTATE_H |
---|
Note: See
TracBrowser
for help on using the repository browser.