diff options
Diffstat (limited to 'src/libjin/Graphics/Shader.h')
-rw-r--r-- | src/libjin/Graphics/Shader.h | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/libjin/Graphics/Shader.h b/src/libjin/Graphics/Shader.h index dcd0b62..6339883 100644 --- a/src/libjin/Graphics/Shader.h +++ b/src/libjin/Graphics/Shader.h @@ -13,46 +13,46 @@ namespace jin { -namespace graphics -{ - - class Shader - { - public: - static Shader* createShader(const std::string& program); - static inline Shader* getCurrentShader() { return currentShader; } - static void unuse(); - - virtual ~Shader(); - - void use(); - void sendFloat(const char* name, float number); - void sendTexture(const char* name, const Texture* image); - void sendInt(const char* name, int value); - void sendVec2(const char* name, float x, float y); - void sendVec3(const char* name, float x, float y, float z); - void sendVec4(const char* name, float x, float y, float z, float w); - void sendCanvas(const char* name, const Canvas* canvas); - void sendColor(const char* name, const Color* col); - void sendMatrix4(const char* name, const math::Matrix* mat4); - - void bindVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); - void bindUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); - - protected: - static Shader* currentShader; - - GLint claimTextureUnit(const std::string& name); - Shader(const std::string& program); - bool compile(const std::string& program); - - GLuint pid; - GLint currentTextureUnit; - std::map<std::string, GLint> textureUnits; - - }; - -} // graphics + namespace graphics + { + + class Shader + { + public: + static Shader* createShader(const std::string& program); + static inline Shader* getCurrentShader() { return currentShader; } + static void unuse(); + + virtual ~Shader(); + + void use(); + void sendFloat(const char* name, float number); + void sendTexture(const char* name, const Texture* image); + void sendInt(const char* name, int value); + void sendVec2(const char* name, float x, float y); + void sendVec3(const char* name, float x, float y, float z); + void sendVec4(const char* name, float x, float y, float z, float w); + void sendCanvas(const char* name, const Canvas* canvas); + void sendColor(const char* name, const Color* col); + void sendMatrix4(const char* name, const math::Matrix* mat4); + + void bindVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void bindUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + + protected: + static Shader* currentShader; + + GLint claimTextureUnit(const std::string& name); + Shader(const std::string& program); + bool compile(const std::string& program); + + GLuint pid; + GLint currentTextureUnit; + std::map<std::string, GLint> textureUnits; + + }; + + } // graphics } // jin #endif // LIBJIN_MODULES_RENDER |