diff options
Diffstat (limited to 'src/libjin/Graphics/shaders')
-rw-r--r-- | src/libjin/Graphics/shaders/je_base.shader.h | 3 | ||||
-rw-r--r-- | src/libjin/Graphics/shaders/je_shader.cpp | 4 | ||||
-rw-r--r-- | src/libjin/Graphics/shaders/je_shader.h | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/libjin/Graphics/shaders/je_base.shader.h b/src/libjin/Graphics/shaders/je_base.shader.h index e5ca2c3..88fa872 100644 --- a/src/libjin/Graphics/shaders/je_base.shader.h +++ b/src/libjin/Graphics/shaders/je_base.shader.h @@ -26,8 +26,9 @@ static const char* base_vertex = R"( #version 130 core %s - +// Projection matrix uniform mat4 jin_ProjectionMatrix; +// Model view matrix uniform mat4 jin_ModelMatrix; in vec2 jin_VertexCoords; diff --git a/src/libjin/Graphics/shaders/je_shader.cpp b/src/libjin/Graphics/shaders/je_shader.cpp index 3eae5c7..c1abbf0 100644 --- a/src/libjin/Graphics/shaders/je_shader.cpp +++ b/src/libjin/Graphics/shaders/je_shader.cpp @@ -260,14 +260,14 @@ if (success == GL_FALSE) \ glUniformMatrix4fv(loc, 1, GL_FALSE, mat4->getElements()); } - void Shader::bindVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers) + void Shader::setVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers) { GLint loc = glGetAttribLocation(mPID, SHADER_VERTEX_COORDS); glEnableVertexAttribArray(0); glVertexAttribPointer(loc, n, type, GL_FALSE, stride, pointers); } - void Shader::bindUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers) + void Shader::setUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers) { GLint loc = glGetAttribLocation(mPID, SHADER_TEXTURE_COORDS); glEnableVertexAttribArray(1); diff --git a/src/libjin/Graphics/shaders/je_shader.h b/src/libjin/Graphics/shaders/je_shader.h index 09cda51..d89b827 100644 --- a/src/libjin/Graphics/shaders/je_shader.h +++ b/src/libjin/Graphics/shaders/je_shader.h @@ -146,7 +146,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 bindVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void setVertexPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); /// /// Set texture UV coordinates. @@ -156,7 +156,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 bindUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); + void setUVPointer(int n, GLenum type, GLsizei stride, const GLvoid * pointers); protected: /// |