From 5534828032730762f8c1e4daf924b466fffb8be0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 16 Oct 2018 23:09:18 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Shader.h | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'src/libjin/Graphics/Shader.h') 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 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 textureUnits; + + }; + + } // graphics } // jin #endif // LIBJIN_MODULES_RENDER -- cgit v1.1-26-g67d0