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
25 #include "ifilesystem.h"
26 #include "itextures.h"
27 #include "iscriplib.h"
28 #include "qerplugin.h"
30 #include "string/string.h"
31 #include "modulesystem/singletonmodule.h"
35 class ShadersDependencies :
36 public GlobalFileSystemModuleRef,
37 public GlobalTexturesModuleRef,
38 public GlobalScripLibModuleRef,
39 public GlobalRadiantModuleRef
41 ImageModuleRef m_bitmapModule;
43 ShadersDependencies() :
44 m_bitmapModule( "bmp" ){
46 ImageModuleRef& getBitmapModule(){
47 return m_bitmapModule;
53 ShaderSystem* m_shadersq3;
55 typedef ShaderSystem Type;
56 STRING_CONSTANT( Name, "quake3" );
58 ShadersQ3API( ShadersDependencies& dependencies ){
59 g_shadersExtension = "shader";
60 g_shadersDirectory = "scripts/";
61 g_bitmapModule = dependencies.getBitmapModule().getTable();
63 m_shadersq3 = &GetShaderSystem();
68 ShaderSystem* getTable(){
73 typedef SingletonModule<ShadersQ3API, ShadersDependencies, DependenciesAPIConstructor<ShadersQ3API, ShadersDependencies> > ShadersQ3Module;
75 ShadersQ3Module g_ShadersQ3Module;
80 ShaderSystem* m_shadersdoom3;
82 typedef ShaderSystem Type;
83 STRING_CONSTANT( Name, "doom3" );
85 ShadersDoom3API( ShadersDependencies& dependencies ){
86 g_shadersExtension = "mtr";
87 g_shadersDirectory = "materials/";
88 g_enableDefaultShaders = false;
89 g_shaderLanguage = SHADERLANGUAGE_DOOM3;
90 g_useShaderList = false;
91 g_bitmapModule = dependencies.getBitmapModule().getTable();
93 m_shadersdoom3 = &GetShaderSystem();
98 ShaderSystem* getTable(){
99 return m_shadersdoom3;
103 typedef SingletonModule<ShadersDoom3API, ShadersDependencies, DependenciesAPIConstructor<ShadersDoom3API, ShadersDependencies> > ShadersDoom3Module;
105 ShadersDoom3Module g_ShadersDoom3Module;
108 class ShadersQuake4API
110 ShaderSystem* m_shadersquake4;
112 typedef ShaderSystem Type;
113 STRING_CONSTANT( Name, "quake4" );
115 ShadersQuake4API( ShadersDependencies& dependencies ){
116 g_shadersExtension = "mtr";
117 g_shadersDirectory = "materials/";
118 g_enableDefaultShaders = false;
119 g_shaderLanguage = SHADERLANGUAGE_QUAKE4;
120 g_useShaderList = false;
121 g_bitmapModule = dependencies.getBitmapModule().getTable();
123 m_shadersquake4 = &GetShaderSystem();
128 ShaderSystem* getTable(){
129 return m_shadersquake4;
133 typedef SingletonModule<ShadersQuake4API, ShadersDependencies, DependenciesAPIConstructor<ShadersQuake4API, ShadersDependencies> > ShadersQuake4Module;
135 ShadersQuake4Module g_ShadersQuake4Module;
139 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){
140 initialiseModule( server );
142 g_ShadersQ3Module.selfRegister();
143 g_ShadersDoom3Module.selfRegister();
144 g_ShadersQuake4Module.selfRegister();