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.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h
index 8c21ab2..df0fcca 100644
--- a/source/modules/asura-core/graphics/shader.h
+++ b/source/modules/asura-core/graphics/shader.h
@@ -13,6 +13,7 @@
#include <asura-utils/stringmap.hpp>
#include <asura-utils/manager.hpp>
+#include "shader_source.h"
#include "color.h"
#include "texture.h"
#include "gl.h"
@@ -23,8 +24,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>
@@ -32,15 +34,18 @@ namespace AsuraEngine
{
public:
+ LUAX_DECL_FACTORY(Shader);
+
Shader();
~Shader();
///
- /// ӴshaderʱȼǷϴλuniforms location mapʹglAttachShader±ɫ
- /// ɫ
+ /// ӴshaderʱȼǷϴλuniforms location mapʹ
+ /// glAttachShader±ɫɫ
///
- bool Load(const std::string& vertexShader, const std::string& fragmentShader);
+ //bool Load(const std::string& vertexShader, const std::string& fragmentShader);
+ bool Refresh(AEIO::DecodedData* decodeData) override;
///
/// shaderΪ
@@ -92,13 +97,13 @@ namespace AsuraEngine
///
/// OpenGL shader program handle.
///
- GLuint mProgramHandle;
+ GLuint mProgram;
- //------------------------------------------------------------------------------//
+ Luax::LuaxMemberRef mCodeRef;
- public:
+ private:
- LUAX_DECL_FACTORY(SimShader);
+ //----------------------------------------------------------------------------//
LUAX_DECL_METHOD(_New);
LUAX_DECL_METHOD(_Use);
@@ -114,9 +119,7 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_SetUniformVector4);
LUAX_DECL_METHOD(_SetUniformColor);
- private:
-
- Luax::LuaxMemberRef mCodeLuaRef;
+ //----------------------------------------------------------------------------//
};