summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/shader.h
diff options
context:
space:
mode:
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;
}