25 #ifndef SFML_SHADER_HPP
26 #define SFML_SHADER_HPP
31 #include <SFML/Graphics/Export.hpp>
32 #include <SFML/Graphics/Transform.hpp>
33 #include <SFML/Graphics/Color.hpp>
34 #include <SFML/Window/GlResource.hpp>
35 #include <SFML/System/NonCopyable.hpp>
36 #include <SFML/System/Vector2.hpp>
37 #include <SFML/System/Vector3.hpp>
108 bool loadFromFile(
const std::string& filename,
Type type);
129 bool loadFromFile(
const std::string& vertexShaderFilename,
const std::string& fragmentShaderFilename);
149 bool loadFromMemory(
const std::string& shader,
Type type);
170 bool loadFromMemory(
const std::string& vertexShader,
const std::string& fragmentShader);
232 void setParameter(
const std::string& name,
float x);
254 void setParameter(
const std::string& name,
float x,
float y);
277 void setParameter(
const std::string& name,
float x,
float y,
float z);
301 void setParameter(
const std::string& name,
float x,
float y,
float z,
float w);
322 void setParameter(
const std::string& name,
const Vector2f& vector);
343 void setParameter(
const std::string& name,
const Vector3f& vector);
370 void setParameter(
const std::string& name,
const Color& color);
393 void setParameter(
const std::string& name,
const sf::Transform& transform);
425 void setParameter(
const std::string& name,
const Texture& texture);
471 static void bind(
const Shader* shader);
483 static bool isAvailable();
499 bool compile(
const char* vertexShaderCode,
const char* fragmentShaderCode);
508 void bindTextures()
const;
518 int getParamLocation(
const std::string& name);
523 typedef std::map<int, const Texture*> TextureTable;
524 typedef std::map<std::string, int> ParamTable;
529 unsigned int m_shaderProgram;
530 int m_currentTexture;
531 TextureTable m_textures;
538 #endif // SFML_SHADER_HPP