From b5b43bac50ad58949e70bcd1a34b1e6c4765fd51 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 10 Apr 2019 09:03:57 +0800 Subject: *misc --- source/modules/asura-core/graphics/gl.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'source/modules/asura-core/graphics/gl.cpp') 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) -- cgit v1.1-26-g67d0