2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined( INCLUDED_IGLRENDER_H )
23 #define INCLUDED_IGLRENDER_H
26 #include "generic/vector.h"
34 virtual void enable() = 0;
35 virtual void disable() = 0;
36 virtual void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) = 0;
42 OpenGLFogState() : mode( GL_EXP ), density( 0 ), start( 0 ), end( 0 ), index( 0 ), colour( 1, 1, 1, 1 ){
52 //! A collection of opengl state information.
61 eSortMultiLast = 1023,
62 eSortOverbrighten = 1024,
63 eSortFullbright = 1025,
64 eSortHighlight = 1026,
65 eSortTranslucent = 1027,
66 eSortOverlayFirst = 1028,
67 eSortOverlayLast = 2047,
68 eSortControlFirst = 2048,
69 eSortControlLast = 3071,
86 GLenum m_blend_src, m_blend_dst;
92 GLint m_linestipple_factor;
93 GLushort m_linestipple_pattern;
97 OpenGLState() : m_program( 0 ){
101 class OpenGLStateLibrary
104 INTEGER_CONSTANT( Version, 1 );
105 STRING_CONSTANT( Name, "openglshaderlibrary" );
107 virtual void getDefaultState( OpenGLState& state ) const = 0;
109 virtual void insert( const char* name, const OpenGLState& state ) = 0;
110 virtual void erase( const char* name ) = 0;
113 #include "modulesystem.h"
115 template<typename Type>
117 typedef GlobalModule<OpenGLStateLibrary> GlobalOpenGLStateLibraryModule;
119 template<typename Type>
120 class GlobalModuleRef;
121 typedef GlobalModuleRef<OpenGLStateLibrary> GlobalOpenGLStateLibraryModuleRef;
123 inline OpenGLStateLibrary& GlobalOpenGLStateLibrary(){
124 return GlobalOpenGLStateLibraryModule::getTable();