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

Revision 2800, 1.1 KB checked in by mattausch, 16 years ago (diff)

friendly culling debug version with timers, no materials

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
51protected:
52
53        bool mAlphaTestEnabled;
54        bool mTexturesEnabled;
55
56        Mode mMode;
57
58        int mCurrentVboId;
59};
60
61
62}
63
64#endif // __RENDERSTATE_H
Note: See TracBrowser for help on using the repository browser.