summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/shader.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-06-06 00:11:18 +0800
committerchai <chaifix@163.com>2019-06-06 00:11:18 +0800
commit88b882ed0b432c6aff2063213e2f793a36dd25f7 (patch)
tree5fe5d5334050e1a1146aa63e61e88aa2f5170727 /source/modules/asura-core/graphics/shader.h
parentf6c0498c9728a286c13980ed3b60763d02e1b3a0 (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/shader.h')
-rw-r--r--source/modules/asura-core/graphics/shader.h37
1 files changed, 13 insertions, 24 deletions
diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h
index 913332b..b5d866e 100644
--- a/source/modules/asura-core/graphics/shader.h
+++ b/source/modules/asura-core/graphics/shader.h
@@ -14,7 +14,7 @@
#include <asura-utils/stringmap.hpp>
#include <asura-utils/manager.hpp>
-#include "gl.h"
+#include "gfx_device.h"
#include "color.h"
#include "texture.h"
#include "vertex_buffer.h"
@@ -45,18 +45,12 @@ namespace AsuraEngine
void OnUse();
void OnUnuse();
- ///
- /// öԣЩֵframeworkrenderer汻ãImageMesh2DЩԴ
- /// normalizedΪtrueݻڸbuffer¹һ255ɫһ
- /// 0~1
- ///
+ ///
void SetAttribute(int loc, VertexBuffer* vbo, uint offseti = 0, uint stridei = 0, bool normalized = false);
int GetAttributeLocation(const std::string& attribute);
void DisableAttribute(int loc);
- ///
- /// uniform
- ///
+ /// Uniform
bool HasUniform(const std::string& uniform);
uint GetUniformLocation(const std::string& uniform);
void SetUniformFloat(uint loc, float value);
@@ -67,14 +61,11 @@ namespace AsuraEngine
void SetUniformMatrix44(uint loc, const Math::Matrix44& mat44);
bool SetUniformTexture(uint loc, const Texture& texture);
- ///
- /// ñ
- ///
- void SetBuiltInModelMatrix(uint loc);
- void SetBuiltInViewMatrix(uint loc);
- void SetBuiltInProjectionMatrix(uint loc);
- void SetBuiltInMVPMatrix(uint loc);
- void SetBuiltInDrawColor(uint loc);
+ float GetUniformFloat(uint loc);
+ AEMath::Vector2f GetUniformVector2(uint loc);
+ AEMath::Vector3f GetUniformVector3(uint loc);
+ AEMath::Vector4f GetUniformVector4s(uint loc);
+ AEMath::Matrix44 GetUniformMatrix44(uint loc);
GLuint GetGLProgram();
@@ -97,16 +88,12 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_SetUniformVector3);
LUAX_DECL_METHOD(_SetUniformVector4);
LUAX_DECL_METHOD(_SetUniformColor);
- // vertex attributes
+ /// vertex attributes
LUAX_DECL_METHOD(_GetAttributeLocation);
LUAX_DECL_METHOD(_SetAttribute);
LUAX_DECL_METHOD(_DisableAttribute);
- // uniform
- LUAX_DECL_METHOD(_SetBuiltInModelMatrix);
- LUAX_DECL_METHOD(_SetBuiltInViewMatrix);
- LUAX_DECL_METHOD(_SetBuiltInProjectionMatrix);
- LUAX_DECL_METHOD(_SetBuiltInMVPMatrix);
- LUAX_DECL_METHOD(_SetBuiltInDrawColor);
+ /// uniform
+ LUAX_DECL_METHOD(_SetBuiltInUniforms);
//----------------------------------------------------------------------------//
@@ -118,6 +105,8 @@ namespace AsuraEngine
GLuint mFragShader;
};
+
+ typedef Shader GpuProgram;
}
}