00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_GLSTATE_H__32B0E2D0_566D_4438_94E4_B12FE82430B1__INCLUDED_)
00022 #define AFX_GLSTATE_H__32B0E2D0_566D_4438_94E4_B12FE82430B1__INCLUDED_
00023
00024 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
00025 #include "glew.h"
00026
00027 class GLState
00028 {
00029 public:
00030 enum State
00031 {
00032 TEXTURE_ON = 0x1,
00033 TEXTURE_OFF = 0x2,
00034 BLEND_ON = 0x4,
00035 BLEND_OFF = 0x8,
00036 DEPTH_ON = 0x10,
00037 DEPTH_OFF = 0x20,
00038 CUBEMAP_ON = 0x40,
00039 CUBEMAP_OFF = 0x80,
00040 NORMALIZE_ON = 0x100,
00041 NORMALIZE_OFF = 0x200,
00042 LIGHTING_ON = 0x400,
00043 LIGHTING_OFF = 0x800,
00044 LIGHT1_ON = 0x1000,
00045 LIGHT1_OFF = 0x2000,
00046 ALPHATEST_ON = 0x4000,
00047 ALPHATEST_OFF = 0x8000
00048 };
00049
00050 GLState(unsigned wantedState);
00051 virtual ~GLState();
00052
00053 static void setBaseState(unsigned baseState);
00054 static const char *getStateString();
00055 static unsigned int getState() { return currentState_; }
00056 static void setState(unsigned wanted);
00057
00058 static unsigned int getStateSwitches() { return stateSwitches_; }
00059 static void resetStateSwitches() { stateSwitches_ = 0; }
00060
00061 protected:
00062 static unsigned currentState_;
00063 static unsigned int stateSwitches_;
00064 unsigned returnState_;
00065
00066
00067 };
00068
00069 #endif // !defined(AFX_GLSTATE_H__32B0E2D0_566D_4438_94E4_B12FE82430B1__INCLUDED_)