summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/shader.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-06-21 22:47:36 +0800
committerchai <chaifix@163.com>2019-06-21 22:47:36 +0800
commit7894c2971626f9560b4ec77a1ce5a9a64a4f3810 (patch)
treec7bd04fbf4b8e21b48c4d6902c4bd910987e7560 /source/modules/asura-core/graphics/shader.h
parent8ee3f7453bf7b0db5c7358e697e91714d825c87d (diff)
*格式化代码
Diffstat (limited to 'source/modules/asura-core/graphics/shader.h')
-rw-r--r--source/modules/asura-core/graphics/shader.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h
index 61aa6f1..30a386e 100644
--- a/source/modules/asura-core/graphics/shader.h
+++ b/source/modules/asura-core/graphics/shader.h
@@ -26,9 +26,9 @@ namespace AsuraEngine
{
///
- /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩ
- /// uniformsuseɫķ༭ÿshaderͨshaderҵuniforms
- /// ¶frameworkmaterialá
+ /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩ uniformsuseɫ
+ /// ķ༭ÿshaderͨshaderҵuniforms¶frameworkmaterial
+ /// á
///
class Shader ASURA_FINAL
: public Scripting::Portable<Shader>
@@ -40,10 +40,16 @@ namespace AsuraEngine
~Shader();
+ static void SetActive(Shader* shader);
+ static Shader* GetActive();
+
bool Load(const std::string& vert, const std::string& frag) ASURA_THROW(Exception);
- void OnUse();
- void OnUnuse();
+ // ʹSetActiveлshaderʱ
+ void OnEnable();
+ void OnDisable();
+ // Draw call֮
+ void OnUsed();
void SetAttribute(int loc, VertexBuffer* vbo, uint offseti = 0, uint stridei = 0, bool normalized = false);
int GetAttributeLocation(const std::string& attribute);
@@ -105,7 +111,6 @@ namespace AsuraEngine
};
- // ڱһGPU
typedef Shader GpuProgram;
}