From af7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 21:45:33 +0800 Subject: *misc --- source/modules/asura-core/graphics/shader.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/modules/asura-core/graphics/shader.h') diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h index ae24548..9077599 100644 --- a/source/modules/asura-core/graphics/shader.h +++ b/source/modules/asura-core/graphics/shader.h @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -36,7 +37,7 @@ namespace AsuraEngine LUAX_DECL_FACTORY(Shader); - Shader(); + Shader() asura_throw(Exception); ~Shader(); @@ -44,8 +45,7 @@ namespace AsuraEngine /// 从代码编译shader,编译时会先检测是否有上次缓存的uniforms location map。使用 /// glAttachShader重新编译生成着色器,不会重新申请着色器程序。 /// - //bool Load(const std::string& vertexShader, const std::string& fragmentShader); - bool Refresh(AEIO::DecodedData* decodeData) override; + bool Renew(AEIO::DecodedData* decodeData) override; /// /// 将当期shader设置为活动 @@ -98,6 +98,8 @@ namespace AsuraEngine /// OpenGL shader program handle. /// GLuint mProgram; + GLuint mVertShader; + GLuint mFragShader; Luax::LuaxMemberRef mCodeRef; @@ -109,6 +111,7 @@ namespace AsuraEngine LUAX_DECL_METHOD(_Use); LUAX_DECL_METHOD(_Unuse); LUAX_DECL_METHOD(_Load); + LUAX_DECL_METHOD(_Renew); LUAX_DECL_METHOD(_HasUniform); LUAX_DECL_METHOD(_GetUniformLocation); LUAX_DECL_METHOD(_SetBuiltInUniforms); @@ -121,6 +124,9 @@ namespace AsuraEngine //----------------------------------------------------------------------------// + std::string GetProgramWarnings(); + std::string GetShaderWarnings(GLuint shader); + }; } -- cgit v1.1-26-g67d0