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);
312 void setUniform(
const std::string& name,
const Vector2f& vec);
320 void setUniform(
const std::string& name,
const Vector3f& vec);
328 void setUniform(
const std::string& name,
const Vector4f& vec);
336 void setUniform(
const std::string& name,
const Matrix3f& mat);
344 void setUniform(
const std::string& name,
const Matrix4f& mat);
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
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.
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.
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
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.