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
23 #include "ifilesystem.h"
24 #include "itextures.h"
25 #include "iscriplib.h"
26 #include "qerplugin.h"
28 #include "string/string.h"
29 #include "modulesystem/singletonmodule.h"
33 class ShadersDependencies :
34 public GlobalFileSystemModuleRef,
35 public GlobalTexturesModuleRef,
36 public GlobalScripLibModuleRef,
37 public GlobalRadiantModuleRef
39 ImageModuleRef m_bitmapModule;
41 ShadersDependencies() :
42 m_bitmapModule( "png" ){
44 ImageModuleRef& getBitmapModule(){
45 return m_bitmapModule;
51 ShaderSystem* m_shadersq3;
53 typedef ShaderSystem Type;
54 STRING_CONSTANT( Name, "quake3" );
56 ShadersQ3API( ShadersDependencies& dependencies ){
57 g_shadersExtension = "shader";
58 g_shadersDirectory = "scripts/";
59 g_bitmapModule = dependencies.getBitmapModule().getTable();
61 m_shadersq3 = &GetShaderSystem();
66 ShaderSystem* getTable(){
71 typedef SingletonModule<ShadersQ3API, ShadersDependencies, DependenciesAPIConstructor<ShadersQ3API, ShadersDependencies> > ShadersQ3Module;
73 ShadersQ3Module g_ShadersQ3Module;
78 ShaderSystem* m_shadersdoom3;
80 typedef ShaderSystem Type;
81 STRING_CONSTANT( Name, "doom3" );
83 ShadersDoom3API( ShadersDependencies& dependencies ){
84 g_shadersExtension = "mtr";
85 g_shadersDirectory = "materials/";
86 g_enableDefaultShaders = false;
87 g_shaderLanguage = SHADERLANGUAGE_DOOM3;
88 g_useShaderList = false;
89 g_bitmapModule = dependencies.getBitmapModule().getTable();
91 m_shadersdoom3 = &GetShaderSystem();
96 ShaderSystem* getTable(){
97 return m_shadersdoom3;
101 typedef SingletonModule<ShadersDoom3API, ShadersDependencies, DependenciesAPIConstructor<ShadersDoom3API, ShadersDependencies> > ShadersDoom3Module;
103 ShadersDoom3Module g_ShadersDoom3Module;
106 class ShadersQuake4API
108 ShaderSystem* m_shadersquake4;
110 typedef ShaderSystem Type;
111 STRING_CONSTANT( Name, "quake4" );
113 ShadersQuake4API( ShadersDependencies& dependencies ){
114 g_shadersExtension = "mtr";
115 g_shadersDirectory = "materials/";
116 g_enableDefaultShaders = false;
117 g_shaderLanguage = SHADERLANGUAGE_QUAKE4;
118 g_useShaderList = false;
119 g_bitmapModule = dependencies.getBitmapModule().getTable();
121 m_shadersquake4 = &GetShaderSystem();
126 ShaderSystem* getTable(){
127 return m_shadersquake4;
131 typedef SingletonModule<ShadersQuake4API, ShadersDependencies, DependenciesAPIConstructor<ShadersQuake4API, ShadersDependencies> > ShadersQuake4Module;
133 ShadersQuake4Module g_ShadersQuake4Module;
137 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){
138 initialiseModule( server );
140 g_ShadersQ3Module.selfRegister();
141 g_ShadersDoom3Module.selfRegister();
142 g_ShadersQuake4Module.selfRegister();