iglrender.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2001-2006, William Joseph.
00003 All Rights Reserved.
00004 
00005 This file is part of GtkRadiant.
00006 
00007 GtkRadiant is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 GtkRadiant is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with GtkRadiant; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 */
00021 
00022 #if !defined(INCLUDED_IGLRENDER_H)
00023 #define INCLUDED_IGLRENDER_H
00024 
00025 #include "igl.h"
00026 #include "math/Vector3.h"
00027 #include "math/Vector4.h"
00028 
00030 class OpenGLState {
00031 public:
00032     enum ESort {
00033         eSortFirst = 0,
00034         eSortOpaque = 1,
00035         eSortMultiFirst = 2,
00036         eSortMultiLast = 1023,
00037         eSortOverbrighten = 1024,
00038         eSortFullbright = 1025,
00039         eSortHighlight = 1026,
00040         eSortTranslucent = 1027,
00041         eSortOverlayFirst = 1028,
00042         eSortOverlayLast = 2047,
00043         eSortControlFirst = 2048,
00044         eSortControlLast = 3071,
00045         eSortGUI0 = 3072,
00046         eSortGUI1 = 3073,
00047         eSortLast = 4096,
00048     };
00049 
00050     unsigned int m_state;
00051     std::size_t m_sort;
00052     GLint m_texture;
00053     GLint m_texture1;
00054     GLint m_texture2;
00055     GLint m_texture3;
00056     GLint m_texture4;
00057     GLint m_texture5;
00058     GLint m_texture6;
00059     GLint m_texture7;
00060     Vector4 m_colour;
00061     GLenum m_blend_src, m_blend_dst;
00062     GLenum m_depthfunc;
00063     GLenum m_alphafunc;
00064     GLfloat m_alpharef;
00065     GLfloat m_linewidth;
00066     GLfloat m_pointsize;
00067     GLint m_linestipple_factor;
00068     GLushort m_linestipple_pattern;
00069 
00070     OpenGLState() {
00071     }
00072 };
00073 
00074 class OpenGLStateLibrary {
00075 public:
00076     virtual ~OpenGLStateLibrary(){}
00077 
00078     INTEGER_CONSTANT(Version, 1);
00079     STRING_CONSTANT(Name, "openglshaderlibrary");
00080 
00081     virtual void getDefaultState(OpenGLState& state) const = 0;
00082 
00083     virtual void insert(const std::string& name, const OpenGLState& state) = 0;
00084     virtual void erase(const std::string& name) = 0;
00085 };
00086 
00087 #include "modulesystem.h"
00088 
00089 template<typename Type>
00090 class GlobalModule;
00091 typedef GlobalModule<OpenGLStateLibrary> GlobalOpenGLStateLibraryModule;
00092 
00093 template<typename Type>
00094 class GlobalModuleRef;
00095 typedef GlobalModuleRef<OpenGLStateLibrary> GlobalOpenGLStateLibraryModuleRef;
00096 
00097 inline OpenGLStateLibrary& GlobalOpenGLStateLibrary() {
00098     return GlobalOpenGLStateLibraryModule::getTable();
00099 }
00100 
00101 #endif

Generated by  doxygen 1.6.2