MercuryGLState.h

Go to the documentation of this file.
00001 #ifndef MERCURYGLSTATE_H
00002 #define MERCURYGLSTATE_H
00003 
00004 const static unsigned long MGLS_DEPTHWRITE = 0x1;
00005 const static unsigned long MGLS_DEPTHTEST = 0x2;
00006 const static unsigned long MGLS_COLORWRITE = 0x4;
00007 const static unsigned long MGLS_ALPHATEST = 0x8;
00008 const static unsigned long MGLS_BLEND = 0x10;
00009 const static unsigned long MGLS_VERTEXARRAY = 0x20;
00010 const static unsigned long MGLS_NORMALARRAY = 0x40;
00011 const static unsigned long MGLS_UVARRAY = 0x80;
00012 const static unsigned long MGLS_TEXTURING = 0x100;
00013 const static unsigned long MGLS_LIGHTING = 0x200;
00014 const static unsigned long MGLS_STENCILTEST = 0x400;
00015 const static unsigned long MGLS_SHADER = 0x800;
00016 const static unsigned long MGLS_CLEARFRAME = 0x1000;
00017 //const static unsigned long MGLS_TRANSLUCENT = 0x80000000; 
00018 const static unsigned long MGLS_OPAQUE = 0x80000000;
00019 const static unsigned long MGLS_ALL = 0xFFFFFFFF;
00020 
00021 class MercuryGLState
00022 {
00023 public:
00024     MercuryGLState()
00025         :m_state(0)
00026     {}
00027     inline void Enable(unsigned long mask) { m_state = m_state|mask; }
00028     inline void Disable(unsigned long mask) { m_state = m_state&(~mask); }
00029     inline bool GetState(unsigned long mask) const  {return (m_state&mask)!=0; }
00030     inline unsigned long GetStates() const { return m_state; }
00031     MercuryGLState operator^(const MercuryGLState& states);
00032     MercuryGLState operator&(const MercuryGLState& states);
00033 
00034     inline MercuryGLState operator&=(const MercuryGLState& states) { m_state&=states.m_state; return *this; }
00035 private:
00036     unsigned long m_state; 
00037 };
00038 
00039 #endif

Hosted by SourceForge.net Logo