diff options
author | chai <chaifix@163.com> | 2018-12-21 19:02:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-21 19:02:22 +0800 |
commit | 84a663cb70b057a5ce0c9ff1910bc2eb9c0ba653 (patch) | |
tree | 625d2a7804c6f29aac367098972f96a47fcb7ae3 /src/libjin/graphics/shaders/je_shader.h | |
parent | 90cd4ff40e647e4150638e69f80ac587ceff1631 (diff) |
+2d mesh
Diffstat (limited to 'src/libjin/graphics/shaders/je_shader.h')
-rw-r--r-- | src/libjin/graphics/shaders/je_shader.h | 22 |
1 files changed, 19 insertions, 3 deletions
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<std::string, GLint> mTextureUnits; + GLint mAttributeIndex; }; |