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)
53 //! A collection of opengl state information.
62 eSortMultiLast = 1023,
63 eSortOverbrighten = 1024,
64 eSortFullbright = 1025,
65 eSortHighlight = 1026,
66 eSortTranslucent = 1027,
67 eSortOverlayFirst = 1028,
68 eSortOverlayLast = 2047,
69 eSortControlFirst = 2048,
70 eSortControlLast = 3071,
87 GLenum m_blend_src, m_blend_dst;
93 GLint m_linestipple_factor;
94 GLushort m_linestipple_pattern;
98 OpenGLState() : m_program(0)
103 class OpenGLStateLibrary
106 INTEGER_CONSTANT(Version, 1);
107 STRING_CONSTANT(Name, "openglshaderlibrary");
109 virtual void getDefaultState(OpenGLState& state) const = 0;
111 virtual void insert(const char* name, const OpenGLState& state) = 0;
112 virtual void erase(const char* name) = 0;
115 #include "modulesystem.h"
117 template<typename Type>
119 typedef GlobalModule<OpenGLStateLibrary> GlobalOpenGLStateLibraryModule;
121 template<typename Type>
122 class GlobalModuleRef;
123 typedef GlobalModuleRef<OpenGLStateLibrary> GlobalOpenGLStateLibraryModuleRef;
125 inline OpenGLStateLibrary& GlobalOpenGLStateLibrary()
127 return GlobalOpenGLStateLibraryModule::getTable();