From 84a663cb70b057a5ce0c9ff1910bc2eb9c0ba653 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 21 Dec 2018 19:02:22 +0800 Subject: +2d mesh --- src/libjin/graphics/shaders/je_shader.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/libjin/graphics/shaders/je_shader.h') diff --git a/src/libjin/graphics/shaders/je_shader.h b/src/libjin/graphics/shaders/je_shader.h index 9056d51..6a2db9c 100644 --- a/src/libjin/graphics/shaders/je_shader.h +++ b/src/libjin/graphics/shaders/je_shader.h @@ -132,7 +132,7 @@ namespace JinEngine /// @param stride Byte offset between consecutive generic vertex attributes. /// @param pointers Pointer to the first component of the first generic vertex attribute in the array. /// - void uploadVertices(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void uploadVertices(int n, GLenum type, GLsizei stride, const GLvoid * pointers, GLboolean normalized = GL_FALSE); /// /// Set texture UV coordinates. @@ -142,12 +142,27 @@ namespace JinEngine /// @param stride Byte offset between consecutive generic vertex attributes. /// @param pointers Pointer to the first component of the first generic vertex attribute in the array. /// - void uploadUV(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void uploadUV(int n, GLenum type, GLsizei stride, const GLvoid * pointers, GLboolean normalized = GL_FALSE); + + /// + /// Upload vertex color array. + /// + void uploadColor(int n, GLenum type, GLsizei stride, const GLvoid * pointers, GLboolean normalized = GL_FALSE); /// /// Set attribute. /// - void uploadAttribute(const String& name, int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void uploadAttribute(const String& name, int n, GLenum type, GLsizei stride, const GLvoid * pointers, GLboolean normalized = GL_FALSE); + + /// + /// Reset attribute index. + /// + void beginUploadAttributes(); + + /// + /// Reset attribute index. + /// + void endUploadAttributes(); /// /// Program ID. @@ -174,6 +189,7 @@ namespace JinEngine GLuint mPID; GLint mCurrentTextureUnit; std::map mTextureUnits; + GLint mAttributeIndex; }; -- cgit v1.1-26-g67d0