25#ifndef SFML_SHADER_HPP
26#define SFML_SHADER_HPP
138 bool loadFromFile(
const std::string& vertexShaderFilename,
const std::string& fragmentShaderFilename);
179 bool loadFromMemory(
const std::string& vertexShader,
const std::string& fragmentShader);
310 void setParameter(
const std::string& name,
float x,
float y,
float z,
float w);
511 bool compile(
const char* vertexShaderCode,
const char* fragmentShaderCode);
520 void bindTextures()
const;
530 int getParamLocation(
const std::string& name);
535 typedef std::map<int, const Texture*> TextureTable;
536 typedef std::map<std::string, int> ParamTable;
541 unsigned int m_shaderProgram;
542 int m_currentTexture;
543 TextureTable m_textures;
#define SFML_GRAPHICS_API
Utility class for manipulating RGBA colors.
GlResource()
Default constructor.
NonCopyable()
Default constructor.
bool loadFromFile(const std::string &filename, Type type)
Load either the vertex or fragment shader from a file.
static void bind(const Shader *shader)
Bind a shader for rendering.
Shader()
Default constructor.
bool loadFromStream(InputStream &stream, Type type)
Load either the vertex or fragment shader from a custom stream.
void setParameter(const std::string &name, const sf::Transform &transform)
Change a matrix parameter of the shader.
void setParameter(const std::string &name, const Vector2f &vector)
Change a 2-components vector parameter of the shader.
bool loadFromStream(InputStream &vertexShaderStream, InputStream &fragmentShaderStream)
Load both the vertex and fragment shaders from custom streams.
void setParameter(const std::string &name, float x)
Change a float parameter of the shader.
void setParameter(const std::string &name, float x, float y, float z)
Change a 3-components vector parameter of the shader.
void setParameter(const std::string &name, const Texture &texture)
Change a texture parameter of the shader.
void setParameter(const std::string &name, const Vector3f &vector)
Change a 3-components vector parameter of the shader.
void setParameter(const std::string &name, const Color &color)
Change a color parameter of the shader.
void setParameter(const std::string &name, float x, float y)
Change a 2-components vector parameter of the shader.
static CurrentTextureType CurrentTexture
Represents the texture of the object being drawn.
bool loadFromMemory(const std::string &shader, Type type)
Load either the vertex or fragment shader from a source code in memory.
bool loadFromFile(const std::string &vertexShaderFilename, const std::string &fragmentShaderFilename)
Load both the vertex and fragment shaders from files.
static bool isAvailable()
Tell whether or not the system supports shaders.
bool loadFromMemory(const std::string &vertexShader, const std::string &fragmentShader)
Load both the vertex and fragment shaders from source codes in memory.
void setParameter(const std::string &name, float x, float y, float z, float w)
Change a 4-components vector parameter of the shader.
void setParameter(const std::string &name, CurrentTextureType)
Change a texture parameter of the shader.
@ Fragment
Fragment (pixel) shader.
Image living on the graphics card that can be used for drawing.
Vector2< float > Vector2f
Vector3< float > Vector3f
Special type that can be passed to setParameter, and that represents the texture of the object being ...