The underlying data of a shader is loaded from shader files.
More...
#include <ShaderDataFile.h>
Inherits IShaderData.
|
| ShaderDataFile (const std::string &shaderFileName, const std::string &shaderVersionDesktop, const std::string &shaderVersionES, GLuint maxLights, bool variableNumberOfLights, bool ambientLighting, bool diffuseLighting, bool specularLighting, bool cubicReflectionMap) |
| Constructor. More...
|
|
| ShaderDataFile (const std::string &vertShaderFileName, const std::string &fragShaderFileName, const std::string &shaderVersionDesktop, const std::string &shaderVersionES, GLuint maxLights, bool variableNumberOfLights, bool ambientLighting, bool diffuseLighting, bool specularLighting, bool cubicReflectionMap) |
| Constructor. More...
|
|
virtual | ~ShaderDataFile () |
| Virtual destructor. More...
|
|
ShaderDataFile & | load (const std::string &shaderFileName) |
| Loads shader from file. More...
|
|
ShaderDataFile & | load (const std::string &vertShaderFileName, const std::string &fragShaderFileName) |
| Loads shader from file. More...
|
|
std::string | getVertShaderSrc () const |
| Gets the source code of the vertex shader as a string. More...
|
|
std::string | getFragShaderSrc () const |
| Gets the source code of the fragment shader as a string. More...
|
|
GLuint | getMaxLights () const |
| Get the maximum number of lights. More...
|
|
bool | supportsVariableNumberOfLights () const |
| Returns true if the number of lights is variable in the shader. More...
|
|
bool | supportsAmbientLighting () const |
| Returns true if the shader supports ambient lighting. More...
|
|
bool | supportsDiffuseLighting () const |
| Returns true if the shader supports diffuse lighting. More...
|
|
bool | supportsSpecularLighting () const |
| Returns true if the shader supports specular lighting. More...
|
|
bool | supportsCubicReflectionMap () const |
| Returns true if the shader supports a cubic reflection map. More...
|
|
bool | isValid () const |
| Returns true if the shader is valid. More...
|
|
virtual | ~IShaderData () |
| Virtual destructor. More...
|
|
The underlying data of a shader is loaded from shader files.
- Author
- David Steiner
ShaderDataFile::ShaderDataFile |
( |
const std::string & |
shaderFileName, |
|
|
const std::string & |
shaderVersionDesktop, |
|
|
const std::string & |
shaderVersionES, |
|
|
GLuint |
maxLights, |
|
|
bool |
variableNumberOfLights, |
|
|
bool |
ambientLighting, |
|
|
bool |
diffuseLighting, |
|
|
bool |
specularLighting, |
|
|
bool |
cubicReflectionMap |
|
) |
| |
Constructor.
- Parameters
-
[in] | shaderFileName | The filename of both the vertex and fragment shader (without filename extension!) |
[in] | shaderVersionDesktop | The shader version to be used for desktop systems |
[in] | shaderVersionES | The shader version to be used for embedded systems (iOS) |
[in] | maxLights | The maximum number of light sources to be used |
[in] | variableNumberOfLights | True if the number of lights may vary, otherwise the number of lights has to be the same as specified as maximum number of lights |
[in] | ambientLighting | Set true if the shader supports ambient lighting |
[in] | diffuseLighting | Set true if the shader supports diffuse lighting |
[in] | specularLighting | Set true if the shader supports specular lighting |
[in] | cubicReflectionMap | Set true if the shader supports a cubic reflection map |
ShaderDataFile::ShaderDataFile |
( |
const std::string & |
vertShaderFileName, |
|
|
const std::string & |
fragShaderFileName, |
|
|
const std::string & |
shaderVersionDesktop, |
|
|
const std::string & |
shaderVersionES, |
|
|
GLuint |
maxLights, |
|
|
bool |
variableNumberOfLights, |
|
|
bool |
ambientLighting, |
|
|
bool |
diffuseLighting, |
|
|
bool |
specularLighting, |
|
|
bool |
cubicReflectionMap |
|
) |
| |
Constructor.
- Parameters
-
[in] | vertShaderFileName | The filename of the vertex shader (including filename extension!) |
[in] | fragShaderFileName | The filename of the fragment shader (including filename extension!) |
[in] | shaderVersionDesktop | The shader version to be used for desktop systems |
[in] | shaderVersionES | The shader version to be used for embedded systems (iOS) |
[in] | maxLights | The maximum number of light sources to be used |
[in] | variableNumberOfLights | True if the number of lights may vary, otherwise the number of lights has to be the same as specified as maximum number of lights |
[in] | ambientLighting | Set true if the shader supports ambient lighting |
[in] | diffuseLighting | Set true if the shader supports diffuse lighting |
[in] | specularLighting | Set true if the shader supports specular lighting |
[in] | cubicReflectionMap | Set true if the shader supports a cubic reflection map |
virtual ShaderDataFile::~ShaderDataFile |
( |
| ) |
|
|
inlinevirtual |
std::string ShaderDataFile::getFragShaderSrc |
( |
| ) |
const |
|
inlinevirtual |
Gets the source code of the fragment shader as a string.
Implements IShaderData.
GLuint ShaderDataFile::getMaxLights |
( |
| ) |
const |
|
inlinevirtual |
Get the maximum number of lights.
Implements IShaderData.
std::string ShaderDataFile::getVertShaderSrc |
( |
| ) |
const |
|
inlinevirtual |
Gets the source code of the vertex shader as a string.
Implements IShaderData.
bool ShaderDataFile::isValid |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the shader is valid.
Implements IShaderData.
ShaderDataFile & ShaderDataFile::load |
( |
const std::string & |
shaderFileName | ) |
|
Loads shader from file.
- Parameters
-
[in] | shaderFileName | The filename of both the vertex and fragment shader (without filename extension!) |
ShaderDataFile & ShaderDataFile::load |
( |
const std::string & |
vertShaderFileName, |
|
|
const std::string & |
fragShaderFileName |
|
) |
| |
Loads shader from file.
- Parameters
-
[in] | vertShaderFileName | The filename of the vertex shader (including filename extension!) |
[in] | fragShaderFileName | The filename of the fragment shader (including filename extension!) |
bool ShaderDataFile::supportsAmbientLighting |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the shader supports ambient lighting.
Implements IShaderData.
bool ShaderDataFile::supportsCubicReflectionMap |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the shader supports a cubic reflection map.
Implements IShaderData.
bool ShaderDataFile::supportsDiffuseLighting |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the shader supports diffuse lighting.
Implements IShaderData.
bool ShaderDataFile::supportsSpecularLighting |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the shader supports specular lighting.
Implements IShaderData.
bool ShaderDataFile::supportsVariableNumberOfLights |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the number of lights is variable in the shader.
Implements IShaderData.