summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/shader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-core/graphics/shader.cpp')
-rw-r--r--source/modules/asura-core/graphics/shader.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/source/modules/asura-core/graphics/shader.cpp b/source/modules/asura-core/graphics/shader.cpp
index a0c14b4..833cef0 100644
--- a/source/modules/asura-core/graphics/shader.cpp
+++ b/source/modules/asura-core/graphics/shader.cpp
@@ -176,12 +176,6 @@ namespace AsuraEngine
glUniform4f(loc, color.r, color.g, color.b, color.a);
}
- //void Shader::GetUniform()
- //{
- // //if(gl.state.shader == this)
- // // glGetUniformfv()
- //}
-
uint Shader::GetGLTextureUnitCount()
{
GLint maxTextureUnits;
@@ -250,5 +244,30 @@ namespace AsuraEngine
glDisableVertexAttribArray(loc);
}
+ void Shader::SetBuiltInModelMatrix(uint loc)
+ {
+ SetUniformMatrix44(loc, gl.GetMatrix(MATRIX_MODE_MODEL));
+ }
+
+ void Shader::SetBuiltInViewMatrix(uint loc)
+ {
+ SetUniformMatrix44(loc, gl.GetMatrix(MATRIX_MODE_VIEW));
+ }
+
+ void Shader::SetBuiltInProjectionMatrix(uint loc)
+ {
+ SetUniformMatrix44(loc, gl.GetMatrix(MATRIX_MODE_PROJECTION));
+ }
+
+ void Shader::SetBuiltInMVPMatrix(uint loc)
+ {
+ SetUniformMatrix44(loc, gl.GetMVPMatrix());
+ }
+
+ void Shader::SetBuiltInDrawColor(uint loc)
+ {
+ SetUniformColor(loc, gl.GetDrawColor());
+ }
+
}
} \ No newline at end of file