Revision 2773,
1.1 KB
checked in by mattausch, 17 years ago
(diff) |
implemented multiqueries, but still buggy version
|
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 | /** Stores the current vbo id.
|
---|
44 | */
|
---|
45 | inline void SetCurrentVboId(int id) { mCurrentVboId = id; }
|
---|
46 | /** Returns the current vbo id.
|
---|
47 | */
|
---|
48 | inline int GetCurrentVboId() { return mCurrentVboId; }
|
---|
49 |
|
---|
50 | protected:
|
---|
51 |
|
---|
52 | bool mAlphaTestEnabled;
|
---|
53 | bool mTexturesEnabled;
|
---|
54 |
|
---|
55 | Mode mMode;
|
---|
56 |
|
---|
57 | int mCurrentVboId;
|
---|
58 | };
|
---|
59 |
|
---|
60 |
|
---|
61 | }
|
---|
62 |
|
---|
63 | #endif // __RENDERSTATE_H |
---|
Note: See
TracBrowser
for help on using the repository browser.