OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreQuake3ShaderManager.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __QUAKE3SHADERMANAGER_H__
29 #define __QUAKE3SHADERMANAGER_H__
30 
31 #include "OgreBspPrerequisites.h"
32 #include "OgreSingleton.h"
33 #include "OgreResourceManager.h"
34 #include "OgreQuake3Shader.h"
35 #include "OgreBlendMode.h"
36 
37 namespace Ogre {
38 
39 
54  class Quake3ShaderManager : public ScriptLoader, public Singleton<Quake3ShaderManager>, public ResourceAlloc
55  {
56  protected:
57  void parseNewShaderPass(DataStreamPtr& stream, Quake3Shader* pShader);
58  void parseShaderAttrib( const String& line, Quake3Shader* pShader);
59  void parseShaderPassAttrib( const String& line, Quake3Shader* pShader, Quake3Shader::Pass* pPass);
61 
65 
66 
67  public:
69  virtual ~Quake3ShaderManager();
70 
72  const StringVector& getScriptPatterns(void) const;
73 
75  void parseScript(DataStreamPtr& stream, const String& groupName);
76 
78  Real getLoadingOrder(void) const;
79 
81  Quake3Shader* create(const String& name);
83  void clear(void);
85  Quake3Shader* getByName(const String& name);
86 
102  static Quake3ShaderManager& getSingleton(void);
118  static Quake3ShaderManager* getSingletonPtr(void);
119 
120 
121  };
122 
123 }
124 
125 #endif
Real getLoadingOrder(void) const
Gets the relative loading order of scripts of this type.
float Real
Software floating point type.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
map< String, Quake3Shader * >::type Quake3ShaderMap
void parseShaderAttrib(const String &line, Quake3Shader *pShader)
SceneBlendFactor
Blending factors for manually blending objects with the scene.
void clear(void)
Clear all the current shaders.
static Quake3ShaderManager & getSingleton(void)
Override standard Singleton retrieval.
Abstract class defining the interface used by classes which wish to perform script loading to define ...
void parseShaderPassAttrib(const String &line, Quake3Shader *pShader, Quake3Shader::Pass *pPass)
void parseNewShaderPass(DataStreamPtr &stream, Quake3Shader *pShader)
static Quake3ShaderManager * getSingletonPtr(void)
Override standard Singleton retrieval.
void parseScript(DataStreamPtr &stream, const String &groupName)
Parse a script file.
SceneBlendFactor convertBlendFunc(const String &q3func)
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
vector< String >::type StringVector
Quake3Shader * getByName(const String &name)
Retrieve a Quake3Shader by name.
Quake3Shader * create(const String &name)
Create implementation.
Class for managing Quake3 custom shaders.
const StringVector & getScriptPatterns(void) const
Gets the file patterns which should be used to find scripts for this class.
_StringBase String
Class for recording Quake3 shaders.