source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.h @ 2801

Revision 2801, 1.2 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef __RENDERSTATE_H
2#define __RENDERSTATE_H
3
4
5#include "common.h"
6
7
8namespace CHCDemoEngine
9{
10
11/** The current render state.
12*/
13class RenderState
14{
15public:
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        void SetDepthPass(bool depthPass) { mIsDepthPass = depthPass; }
51        bool IsDepthPass() { return mIsDepthPass; }
52
53protected:
54
55        bool mAlphaTestEnabled;
56        bool mTexturesEnabled;
57
58        Mode mMode;
59
60        int mCurrentVboId;
61
62        bool mIsDepthPass;
63};
64
65
66}
67
68#endif // __RENDERSTATE_H
Note: See TracBrowser for help on using the repository browser.