2
// C++ Interface: ShaderManager
7
// Author: Alexey Torkhov <atorkhov@gmail.com>, (C) 2009
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program; if not, write to the Free Software
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
23
#ifndef EMBEROGRE_SHADERMANAGER_H
24
#define EMBEROGRE_SHADERMANAGER_H
26
#include "framework/ConsoleObject.h"
27
#include "services/config/ConfigListener.h"
31
#include <sigc++/signal.h>
36
* @brief Utility class for setup shaders
38
* Utility class for setup shaders. It checks a set of materials and selects
39
* best sheme they work at. Then it performs setup of auxilary things like
42
* @author Alexey Torkhov <atorkhov@gmail.com>
44
class ShaderManager : public Ember::ConsoleObject, public Ember::ConfigListenerContainer
48
* Enumeration of graphics levels
51
// Default scheme is when no scheme specified, very simple textured models
54
// Low level, shader model 2
57
// Medium level, shader model 3
60
// High level, shader model 4
78
* Shaders initialization
83
* Gets current graphics level
85
GraphicsLevel getGraphicsLevel();
88
* Sets current graphics level
90
GraphicsLevel setGraphicsLevel(GraphicsLevel newLevel);
93
* Reimplements the ConsoleObject::runCommand method
95
virtual void runCommand(const std::string &command, const std::string &args);
98
* Sets graphics level at runtime
100
const Ember::ConsoleCommandWrapper SetLevel;
103
* Returns level id by its name
105
GraphicsLevel getLevelByName(const std::string &level);
108
* @brief Emitted when the graphical level is changed.
110
sigc::signal<void> EventLevelChanged;
114
* Current graphics level
116
GraphicsLevel mGraphicsLevel;
119
* Best graphics level supported, determined at initialization time
121
GraphicsLevel mBestGraphicsLevel;
124
* Map of levels and schemes. Also used to convert levels to strings
126
std::map<GraphicsLevel, std::string> mGraphicSchemes;
129
* Checks whether material is supported in current scheme
131
bool checkMaterial(const std::string& materialName, const std::string& schemeName);
134
* Setups PSSM shadows
136
void setPSSMShadows();
144
* @brief Called when the varconf setting for the graphics level changes. This will in turn call setGraphicsLevel.
149
void Config_Level(const std::string& section, const std::string& key, varconf::Variable& variable);