diff options
Diffstat (limited to 'source/modules/asura-core/graphics/gl.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/gl.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/modules/asura-core/graphics/gl.cpp b/source/modules/asura-core/graphics/gl.cpp index 537d40d..e51e8f0 100644 --- a/source/modules/asura-core/graphics/gl.cpp +++ b/source/modules/asura-core/graphics/gl.cpp @@ -82,7 +82,6 @@ namespace AsuraEngine void OpenGL::UseShader(Shader* shader) { glUseProgram(shader->GetGLProgram()); - int err = gl.HasError(); state.shader = shader; shader->OnUse(); } @@ -93,6 +92,17 @@ namespace AsuraEngine state.shader = nullptr; } + Shader* OpenGL::GetShader() + { + return state.shader; + } + + void OpenGL::DrawArrays(GLenum mode, GLint first, GLsizei count) + { + glDrawArrays(mode, first, count); + ++state.drawcall; + } + //------------------------------------------------------------------------------// void OpenGL::SetMatrixMode(MatrixMode mode) @@ -120,9 +130,9 @@ namespace AsuraEngine state.matrix[state.matrixMode].LoadIdentity(); } - void OpenGL::Rotate(float angle, float x, float y, float z) + void OpenGL::Rotate(float angle) { - state.matrix[state.matrixMode].Rotate(angle, x, y, z); + state.matrix[state.matrixMode].Rotate(angle); } void OpenGL::Translate(float x, float y) @@ -130,9 +140,9 @@ namespace AsuraEngine state.matrix[state.matrixMode].Translate(x, y); } - void OpenGL::Scale(float x, float y, float z) + void OpenGL::Scale(float x, float y) { - state.matrix[state.matrixMode].Scale(x, y, z); + state.matrix[state.matrixMode].Scale(x, y); } void OpenGL::Ortho(float l, float r, float b, float t, float n, float f) |