summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/gl.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-05-02 21:42:09 +0800
committerchai <chaifix@163.com>2019-05-02 21:42:09 +0800
commit59a0e32991b5b714b6bdba504b6fbacdcd4b907a (patch)
tree763d10da51491ea88416e159651e97c9193673d8 /source/modules/asura-core/graphics/gl.cpp
parent866e00474be3bfe0e7dac73b720af0b9ebf7109a (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/gl.cpp')
-rw-r--r--source/modules/asura-core/graphics/gl.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/modules/asura-core/graphics/gl.cpp b/source/modules/asura-core/graphics/gl.cpp
index 13c623f..08c50c3 100644
--- a/source/modules/asura-core/graphics/gl.cpp
+++ b/source/modules/asura-core/graphics/gl.cpp
@@ -5,6 +5,7 @@
#include "gl.h"
#include "shader.h"
#include "matrix_stack.h"
+#include "color.h"
using namespace AEMath;
@@ -70,13 +71,10 @@ namespace AsuraEngine
void OpenGL::SetDrawColor(float r, float g, float b, float a)
{
- state.drawColor.x = r;
- state.drawColor.y = g;
- state.drawColor.z = b;
- state.drawColor.w = a;
+ state.drawColor.Set(r, g, b, a);
}
- AEMath::Vector4f& OpenGL::GetDrawColor()
+ Color& OpenGL::GetDrawColor()
{
return state.drawColor;
}
@@ -119,9 +117,6 @@ namespace AsuraEngine
void OpenGL::DrawArrays(GLenum mode, GLint first, GLsizei count)
{
glDrawArrays(mode, first, count);
- // shader disableAttributeArray
- if (state.shader)
- state.shader->DisableAttribArraies();
#if ASURA_GL_PROFILE
++stats.drawCall;
#endif
@@ -179,6 +174,13 @@ namespace AsuraEngine
return state.matrix[mode].GetTop();
}
+ AEMath::Matrix44 OpenGL::GetMVPMatrix()
+ {
+ return state.matrix[MATRIX_MODE_MODEL].GetTop()
+ * state.matrix[MATRIX_MODE_MODEL].GetTop()
+ * state.matrix[MATRIX_MODE_MODEL].GetTop();
+ }
+
uint OpenGL::GetMatrixDepth()
{
return state.matrix[state.matrixMode].GetCapacity();