Loading...
Searching...
No Matches
Ogre::Quake3ShaderManager Class Reference
Plugins » BSPSceneManager

Class for managing Quake3 custom shaders. More...

`#include <OgreQuake3ShaderManager.h>`

Inheritance diagram for Ogre::Quake3ShaderManager:
[legend]

## Public Member Functions

| Quake3ShaderManager ()
virtual | ~Quake3ShaderManager ()
void | clear (void)
| Clear all the current shaders.
Quake3Shader * | create (const String &name)
| Create implementation.
Quake3Shader * | getByName (const String &name)
| Retrieve a Quake3Shader by name.
Real | getLoadingOrder (void) const override
| Gets the loading order for scripts of this type.
const StringVector & | getScriptPatterns (void) const override
| Gets the file patterns which should be used to find scripts for this class.
void | parseScript (DataStreamPtr &stream, const String &groupName) override
| Parse a script file.
Public Member Functions inherited from Ogre::ScriptLoader
virtual | ~ScriptLoader ()
Public Member Functions inherited from Ogre::Singleton< Quake3ShaderManager >
| ~Singleton (void)

## Static Public Member Functions

static Quake3ShaderManager & | getSingleton (void)
| Get the singleton instance.
static Quake3ShaderManager * | getSingletonPtr (void)
| Get the singleton instance.
Static Public Member Functions inherited from Ogre::Singleton< Quake3ShaderManager >
static Quake3ShaderManager & | getSingleton (void)
| Get the singleton instance.
static Quake3ShaderManager * | getSingletonPtr (void)
| Get the singleton instance.

## Detailed Description

Class for managing Quake3 custom shaders.

Quake3 uses .shader files to define custom shaders, or Materials in Ogre-speak. When a surface texture is mentioned in a level file, it includes no file extension meaning that it can either be a standard texture image (+lightmap) if there is only a .jpg or .tga file, or it may refer to a custom shader if a shader with that name is included in one of the .shader files in the scripts/ folder. Because there are multiple shaders per file you have to parse all the .shader files available to know if there is a custom shader available. This class is designed to parse all the .shader files available and save their settings for future use. I choose not to set up Material instances for shaders found since they may or may not be used by a level, so it would be very wasteful to set up Materials since they load texture images for each layer (apart from the lightmap). Once the usage of a shader is confirmed, a full Material instance can be set up from it. Because this is a subclass of ScriptLoader, any files mentioned will be searched for in any path or archive added to the ResourceGroupManager::WORLD_GROUP_NAME group. See ResourceGroupManager for details.

## Constructor & Destructor Documentation

## Quake3ShaderManager()

Ogre::Quake3ShaderManager::Quake3ShaderManager | ( |  | ) |

Referenced by getSingleton(), and getSingletonPtr().

## ~Quake3ShaderManager()

virtual Ogre::Quake3ShaderManager::~Quake3ShaderManager | ( |  | ) |

virtual

## Member Function Documentation

## getScriptPatterns()

const StringVector & Ogre::Quake3ShaderManager::getScriptPatterns | ( | void |  | ) | const

override virtual

Gets the file patterns which should be used to find scripts for this class.

This method is called when a resource group is loaded if you use ResourceGroupManager::_registerScriptLoader.

Returns
  A list of file patterns, in the order they should be searched in.

Implements Ogre::ScriptLoader.

## parseScript()

void Ogre::Quake3ShaderManager::parseScript | ( | DataStreamPtr & | stream,
|  | const String & | groupName )

override virtual

Parse a script file.

Parameters

  stream | Weak reference to a data stream which is the source of the script
  groupName | The name of a resource group which should be used if any resources are created during the parse of this script.

Implements Ogre::ScriptLoader.

## getLoadingOrder()

Real Ogre::Quake3ShaderManager::getLoadingOrder | ( | void |  | ) | const

override virtual

Gets the loading order for scripts of this type.

There are dependencies between some kinds of scripts, and this value enumerates that. Higher values load later during bulk loading tasks.

Returns
  The loading order

Implements Ogre::ScriptLoader.

## create()

Quake3Shader * Ogre::Quake3ShaderManager::create | ( | const String & | name | ) |

Create implementation.

## clear()

void Ogre::Quake3ShaderManager::clear | ( | void |  | ) |

Clear all the current shaders.

## getByName()

Quake3Shader * Ogre::Quake3ShaderManager::getByName | ( | const String & | name | ) |

Retrieve a Quake3Shader by name.

## getSingleton()

Quake3ShaderManager & Ogre::Quake3ShaderManager::getSingleton | ( | void |  | ) |

static

Get the singleton instance.

References Quake3ShaderManager().

## getSingletonPtr()

Quake3ShaderManager * Ogre::Quake3ShaderManager::getSingletonPtr | ( | void |  | ) |

static

Get the singleton instance.

References Quake3ShaderManager().

The documentation for this class was generated from the following file:

- OgreQuake3ShaderManager.h