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.h12
1 files changed, 9 insertions, 3 deletions
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 <map>
#include <string>
+#include <asura-utils/exceptions/exception.h>
#include <asura-utils/scripting/portable.hpp>
#include <asura-utils/io/renewable.h>
#include <asura-utils/math/vector2.hpp>
@@ -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);
+
};
}