38 #ifndef DOXYGEN_SHOULD_SKIP_THIS 198 bool loadFromFile(
const Path& vertexShaderFilename,
const Path& fragmentShaderFilename);
389 bool compile(
const char *vertexShaderCode,
const char *fragmentShaderCode);
391 int getAttributeLocation(
StringRef name);
398 std::map<
int,
const BareTexture *> m_textures;
401 #ifndef DOXYGEN_SHOULD_SKIP_THIS void setUniform(StringRef name, const BareTexture &tex)
Specify a texture for a sampler2D uniform.
bool loadFromMemory(StringRef vertexShader, StringRef fragmentShader)
Load both the vertex and fragment shaders from source codes in memory.
void setUniform(StringRef name, float val)
Specify value for a float uniform.
bool loadFromFile(const Path &filename, Type type)
Load the vertex of fragment shader from a file.
friend class RenderTarget
Definition: Shader.h:388
Shader(const Shader &)=delete
Deleted copy constructor.
bool loadFromFile(const Path &vertexShaderFilename, const Path &fragmentShaderFilename)
Load both the vertex and fragment shaders from files.
void setUniform(StringRef name, int val)
Specify value for a int uniform.
void setUniform(StringRef name, const Vector3f &vec)
Specify value for a vec3 uniform.
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:120
void setUniform(StringRef name, const Vector4f &vec)
Specify value for a vec4 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.
The namespace for gf classes.
Definition: Action.h:34
An image that lives in the graphic memory that can be used for drawing.
Definition: Texture.h:67
void setUniform(StringRef name, const Vector2f &vec)
Specify value for a vec2 uniform.
bool loadFromMemory(StringRef shader, Type type)
Load the vertex or fragment shader from a source code in memory.
Shader()
Default constructor.
Type
Type of shaders.
Definition: Shader.h:125
A constant reference to a string and its size.
Definition: StringRef.h:41
void setUniform(StringRef name, const Matrix4f &mat)
Specify value for a mat4 uniform.
Shader & operator=(const Shader &)=delete
Deleted copy assignment.
void setUniform(StringRef name, const Matrix3f &mat)
Specify value for a mat3 uniform.
#define GF_API
Definition: Portability.h:35
Type for a fragment (or pixel) shader.
Definition: Shader.h:127
Type for a vertex shader.
Definition: Shader.h:126