Shader manager. More...
#include <fbshader.h>
Public Member Functions | |
FBShaderManager () | |
Constructor. More... | |
~FBShaderManager () | |
Destructor. More... | |
FBShader * | CreateShader (const char *pShaderTypeName) |
Creates a shader according to the shader type provided. More... | |
Public Attributes | |
FBStringList | ShaderTypeNames |
List of available shaders. More... | |
FBStringList | ShaderTypeNamesLocalized |
List of available shaders. More... | |
Shader manager.
This class provides access to the list of available shaders, both system shaders and user shaders. The list comes in two versions:
Both of these lists will have the same number of elements. The strings at position i in the lists refer to the same shader type. In cases where there is no localized version of the shader name, the internal name will be used in ShaderTypeNamesLocalized, thus ensuring consistency between the two lists.
It also provides a generic shader creation method that uses the shader type name, internal or localized, to create the new shader instance.
The destruction of shaders is achieved by calling the FBDelete method of a shader instance.
The list of all the instantiated shaders can be obtained from instances of classes FBSystem or FBScene. Both classes have a Shaders property which lists the existing shader instances.
Strings are used instead of enum, define or typedef values to refer to shader types as this proves to be more flexible.
Sample C++ code:
Sample Python code:
Definition at line 221 of file fbshader.h.
FBShaderManager | ( | ) |
Constructor.
~FBShaderManager | ( | ) |
Destructor.
FBShader* CreateShader | ( | const char * | pShaderTypeName | ) |
Creates a shader according to the shader type provided.
This method provides a generic way of creating shaders using the type name, internal or localized. The name of the new shader will be the same as the type name used, subject to changes according to the system's unique name policy.
pShaderTypeName | Name of the type of shader desired. |
FBStringList ShaderTypeNames |
List of available shaders.
This list does provide the complete list of available shaders, both system defined and user defined.
Definition at line 268 of file fbshader.h.
FBStringList ShaderTypeNamesLocalized |
List of available shaders.
This list also provides the complete list of available shaders, but uses the localized named, as they can be seen in the GUI.
The names in this list are a direct match to the items in the list ShaderTypeNames for a given index.
This list is provided as a convenience, to avoid having to use the localization mechanism to match internal and GUI name.
Definition at line 291 of file fbshader.h.