diff options
author | chai <chaifix@163.com> | 2019-03-19 23:06:27 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-19 23:06:27 +0800 |
commit | 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 (patch) | |
tree | f8d1bff50da13e126d08c7345653e002e293202d /Source/Asura.Engine/Graphics/Shader.h | |
parent | 5e2a973516e0729b225da9de0b03015dc5854ac4 (diff) |
*rename
Diffstat (limited to 'Source/Asura.Engine/Graphics/Shader.h')
-rw-r--r-- | Source/Asura.Engine/Graphics/Shader.h | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/Source/Asura.Engine/Graphics/Shader.h b/Source/Asura.Engine/Graphics/Shader.h deleted file mode 100644 index 65f214e..0000000 --- a/Source/Asura.Engine/Graphics/Shader.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef __ASURA_ENGINE_SHADER_H__ -#define __ASURA_ENGINE_SHADER_H__ - -#include <map> -#include <string> - -#include "FileSystem/Reloadable.h" -#include "Scripting/Luax.hpp" -#include "Math/Vector2.hpp" -#include "Math/Vector3.hpp" -#include "Math/Vector4.h" -#include "Math/Matrix44.h" -#include "StringMap.hpp" -#include "scripting/portable.hpp" -#include "Color.h" -#include "Manager.hpp" -#include "Texture.h" -#include "GL.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩuniformsuseɫķ༭ - /// ÿshaderͨshaderҵuniforms¶frameworkmaterialá - /// - class Shader ASURA_FINAL - : public Scripting::Portable<Shader> - , public Filesystem::Reloadable - { - public: - - Shader(); - - ~Shader(); - - /// - /// ӴshaderʱȼǷϴλuniforms location mapʹglAttachShader±ɫ - /// ɫ - /// - bool Load(const std::string& vertexShader, const std::string& fragmentShader); - - /// - /// shaderΪ - /// - void Use(); - - /// - /// shaderΪǻ - /// - void Unuse(); - - /// - /// Ѿ֪uniform location£ֵ - /// - void SetUniformFloat(uint loc, float value); - void SetUniformTexture(uint loc, const Texture& texture); - void SetUniformVector2(uint loc, const Math::Vector2f& vec2); - void SetUniformVector3(uint loc, const Math::Vector3f& vec3); - void SetUniformVector4(uint loc, const Math::Vector4f& vec4); - void SetUniformColor(uint loc, const Color& color); - void SetUniformMatrix44(uint loc, const Math::Matrix44& mat44); - - uint GetUniformLocation(const std::string& uniform); - - bool HasUniform(const std::string& uniform); - - GLuint GetGLProgramHandle(); - - /// - /// texture unitһΪ16 - /// - static uint GetGLTextureUnitCount(); - - private: - - /// - /// ǰshader - /// - static Shader* mCurrentShader; - - /// - /// ñ - /// vec2 Asura_Time xֵΪ뵱ǰʼʱ䣬yֵΪһ֡ʱ - /// vec2 Asura_RenderTargetSize RTĴСΪλ - /// Texture Asura_MainTexture - /// - void SetBuiltInUniforms(); - - /// - /// OpenGL shader program handle. - /// - GLuint mProgramHandle; - - //------------------------------------------------------------------------------------------------------------ - - public: - - LUAX_DECL_FACTORY(SimShader); - - LUAX_DECL_METHOD(l_Use); - LUAX_DECL_METHOD(l_Unuse); - LUAX_DECL_METHOD(l_Load); - LUAX_DECL_METHOD(l_HasUniform); - LUAX_DECL_METHOD(l_GetUniformLocation); - LUAX_DECL_METHOD(l_SetBuiltInUniforms); - LUAX_DECL_METHOD(l_SetUniformFloat); - LUAX_DECL_METHOD(l_SetUniformTexture); - LUAX_DECL_METHOD(l_SetUniformVector2); - LUAX_DECL_METHOD(l_SetUniformVector3); - LUAX_DECL_METHOD(l_SetUniformVector4); - LUAX_DECL_METHOD(l_SetUniformColor); - - private: - - Luax::LuaxMemberRef mCodeLuaRef; - - }; - - } -} - -#endif
\ No newline at end of file |