#ifndef __RENDERSTATE_H #define __RENDERSTATE_H #include "common.h" namespace CHCDemoEngine { /** The current render state. */ class RenderState { public: enum Mode { QUERY, RENDER }; /** Constructor setting render as default state. */ RenderState(); ~RenderState() { Reset(); }; /** This must be called each time before and after an occlusion test. Mode is one of render mode or query mode. Returns true if a state change was issued. */ bool SetState(Mode mode); /** Sets the current render state. */ void SetState(bool texturing, bool alphaTest); /** Returns wether we are in query or render mode */ inline Mode GetMode() const { return mMode; } /** Reset the state. */ void Reset(); /** Stores the current vbo id. */ inline void SetCurrentVboId(int id) { mCurrentVboId = id; } /** Returns the current vbo id. */ inline int GetCurrentVboId() { return mCurrentVboId; } void SetDepthPass(bool depthPass) { mIsDepthPass = depthPass; } bool IsDepthPass() { return mIsDepthPass; } protected: bool mAlphaTestEnabled; bool mTexturesEnabled; Mode mMode; int mCurrentVboId; bool mIsDepthPass; }; } #endif // __RENDERSTATE_H