diff --git a/Samples/readme.md b/Samples/readme.md index 7042e7e67..8385e9a7d 100644 --- a/Samples/readme.md +++ b/Samples/readme.md @@ -11,6 +11,7 @@ Shader shader; shader.attach("main.vert") .attach("main.frag") ... // and so on ... +shader.link(); ``` There is some basic error handling to help you out if you get stuck. diff --git a/Samples/shader.hpp b/Samples/shader.hpp index 74da7ce6c..f5d30105c 100644 --- a/Samples/shader.hpp +++ b/Samples/shader.hpp @@ -22,13 +22,10 @@ namespace Mirage // Public Member Functions Shader & activate(); Shader & attach(std::string const & filename); - GLuint create(std::string const & filename); GLuint get() { return mProgram; } Shader & link(); // Wrap Calls to glUniform - void bind(unsigned int location, float value); - void bind(unsigned int location, glm::mat4 const & matrix); template Shader & bind(std::string const & name, T&& value) { int location = glGetUniformLocation(mProgram, name.c_str()); @@ -38,6 +35,10 @@ namespace Mirage } private: + GLuint create(std::string const & filename); + + void bind(unsigned int location, float value); + void bind(unsigned int location, glm::mat4 const & matrix); // Disable Copying and Assignment Shader(Shader const &) = delete;