37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
197 bool loadFromFile(
const Path& vertexShaderFilename,
const Path& fragmentShaderFilename);
239 bool loadFromMemory(
const std::string& vertexShader,
const std::string& fragmentShader);
296 void setUniform(
const std::string& name,
float val);
304 void setUniform(
const std::string& name,
int val);
388 bool compile(
const char *vertexShaderCode,
const char *fragmentShaderCode);
389 int getUniformLocation(
const std::string& name);
390 int getAttributeLocation(
const std::string& name);
400 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Vector< float, 2 > Vector2f
A float vector with 2 components.
Definition: Vector.h:741
bool loadFromFile(const Path &filename, Type type)
Load the vertex of fragment shader from a file.
friend class RenderTarget
Definition: Shader.h:387
Shader(const Shader &)=delete
Deleted copy constructor.
bool loadFromFile(const Path &vertexShaderFilename, const Path &fragmentShaderFilename)
Load both the vertex and fragment shaders from files.
Matrix< float, 3, 3 > Matrix3f
A float square matrix of size 3.
Definition: Matrix.h:326
bool loadFromStream(InputStream &vertexShaderStream, InputStream &fragmentShaderStream)
Load both the vertex and fragment shaders from custom streams.
An OpenGL vertex and/or fragment shader.
Definition: Shader.h:119
void setUniform(const std::string &name, float val)
Specify value for a float uniform.
bool loadFromStream(InputStream &stream, Type type)
Load the vertex or fragment shader from a custom stream.
static void bind(const Shader *shader)
Bind a shader for rendering.
An image that lives in the graphic memory that can be used for drawing.
Definition: Texture.h:67
void setUniform(const std::string &name, const BareTexture &tex)
Specify a texture for a sampler2D uniform.
void setUniform(const std::string &name, const Vector4f &vec)
Specify value for a vec4 uniform.
Type for a fragment (or pixel) shader.
Definition: Shader.h:126
Shader()
Default constructor.
void setUniform(const std::string &name, const Matrix4f &mat)
Specify value for a mat4 uniform.
Vector< float, 4 > Vector4f
A float vector with 4 components.
Definition: Vector.h:753
Matrix< float, 4, 4 > Matrix4f
A float square matrix of size 4.
Definition: Matrix.h:334
Shader & operator=(const Shader &)=delete
Deleted copy assignment.
bool loadFromMemory(const std::string &shader, Type type)
Load the vertex or fragment shader from a source code in memory.
#define GF_API
Definition: Portability.h:35
Type for a vertex shader.
Definition: Shader.h:125
Vector< float, 3 > Vector3f
A float vector with 3 components.
Definition: Vector.h:747
void setUniform(const std::string &name, int val)
Specify value for a int uniform.
Type
Type of shaders.
Definition: Shader.h:124
bool loadFromMemory(const std::string &vertexShader, const std::string &fragmentShader)
Load both the vertex and fragment shaders from source codes in memory.