GLState.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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_)

Generated on Mon Feb 16 15:14:45 2009 for Scorched3D by  doxygen 1.5.3