![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A segue effect. More...
#include <gf/SegueEffect.h>
Public Member Functions | |
void | setProgress (float progress) |
Set the progress in the effect. More... | |
![]() | |
Shader () | |
Default constructor. More... | |
Shader (const Path &filename, Type type) | |
Load the vertex of fragment shader from a file. More... | |
Shader (const Path &vertexShaderFilename, const Path &fragmentShaderFilename) | |
Load both the vertex and fragment shaders from files. More... | |
Shader (const char *shader, Type type) | |
Load the vertex or fragment shader from a source code in memory. More... | |
Shader (const char *vertexShader, const char *fragmentShader) | |
Load both the vertex and fragment shaders from source codes in memory. More... | |
Shader (InputStream &stream, Type type) | |
Load the vertex or fragment shader from a custom stream. More... | |
Shader (InputStream &vertexShaderStream, InputStream &fragmentShaderStream) | |
Load both the vertex and fragment shaders from custom streams. More... | |
~Shader () | |
Destructor. More... | |
Shader (const Shader &)=delete | |
Deleted copy constructor. More... | |
Shader & | operator= (const Shader &)=delete |
Deleted copy assignment. More... | |
void | setUniform (const std::string &name, float val) |
Specify value for a float uniform. More... | |
void | setUniform (const std::string &name, int val) |
Specify value for a int uniform. More... | |
void | setUniform (const std::string &name, const Vector2f &vec) |
Specify value for a vec2 uniform. More... | |
void | setUniform (const std::string &name, const Vector3f &vec) |
Specify value for a vec3 uniform. More... | |
void | setUniform (const std::string &name, const Vector4f &vec) |
Specify value for a vec4 uniform. More... | |
void | setUniform (const std::string &name, const Vector2i &vec) |
Specify value for a ivec2 uniform. More... | |
void | setUniform (const std::string &name, const Vector3i &vec) |
Specify value for a ivec3 uniform. More... | |
void | setUniform (const std::string &name, const Vector4i &vec) |
Specify value for a ivec4 uniform. More... | |
void | setUniform (const std::string &name, const Matrix3f &mat) |
Specify value for a mat3 uniform. More... | |
void | setUniform (const std::string &name, const Matrix4f &mat) |
Specify value for a mat4 uniform. More... | |
void | setUniform (const std::string &name, const BareTexture &tex) |
Specify a texture for a sampler2D uniform. More... | |
Protected Member Functions | |
SegueEffect (const char *vertexShader, const char *fragmentShader) | |
Load both the vertex and fragment shaders from source codes in memory. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { Vertex , Fragment } |
Type of shaders. More... | |
![]() | |
static void | bind (const Shader *shader) |
Bind a shader for rendering. More... | |
A segue effect.
|
protected |
Load both the vertex and fragment shaders from source codes in memory.
This function loads both the vertex and the fragment shaders. If one of them fails to load, the shader is left empty (the valid shader is unloaded).
The source codes must be a valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.
vertexShader | String containing the source code of the vertex shader |
fragmentShader | String containing the source code of the fragment shader |
void gf::SegueEffect::setProgress | ( | float | progress | ) |
Set the progress in the effect.
progress | A float in the range \( [0, 1] \) |