1 #ifndef B_SHADER_DATA_FILE_H
2 #define B_SHADER_DATA_FILE_H
26 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);
40 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);
55 ShaderDataFile &
load(
const std::string &vertShaderFileName,
const std::string &fragShaderFileName);
97 std::string loadSrc(
const std::string &fileName);
99 void replaceMacro(
const std::string ¯o,
const std::string &value);
103 std::string _vertShaderSrc;
104 std::string _fragShaderSrc;
105 std::string _shaderVersionDesktop;
106 std::string _shaderVersionES;
108 bool _variableNumberOfLights;
109 bool _ambientLighting;
110 bool _diffuseLighting;
111 bool _specularLighting;
112 bool _cubicReflectionMap;
ShaderDataFile & load(const std::string &shaderFileName)
Loads shader from file.
Definition: ShaderDataFile.cpp:22
bool supportsCubicReflectionMap() const
Returns true if the shader supports a cubic reflection map.
Definition: ShaderDataFile.h:87
An interface for the underlying data of a shader.
Definition: IShaderData.h:10
std::string getFragShaderSrc() const
Gets the source code of the fragment shader as a string.
Definition: ShaderDataFile.h:63
GLuint getMaxLights() const
Get the maximum number of lights.
Definition: ShaderDataFile.h:67
bool supportsAmbientLighting() const
Returns true if the shader supports ambient lighting.
Definition: ShaderDataFile.h:75
bool supportsDiffuseLighting() const
Returns true if the shader supports diffuse lighting.
Definition: ShaderDataFile.h:79
bool supportsVariableNumberOfLights() const
Returns true if the number of lights is variable in the shader.
Definition: ShaderDataFile.h:71
bool isValid() const
Returns true if the shader is valid.
Definition: ShaderDataFile.h:91
std::string getVertShaderSrc() const
Gets the source code of the vertex shader as a string.
Definition: ShaderDataFile.h:59
bool supportsSpecularLighting() const
Returns true if the shader supports specular lighting.
Definition: ShaderDataFile.h:83
virtual ~ShaderDataFile()
Virtual destructor.
Definition: ShaderDataFile.h:44
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.
Definition: ShaderDataFile.cpp:10
The underlying data of a shader is loaded from shader files.
Definition: ShaderDataFile.h:9