From 1ab2501db0f9e14f138292880e37120e7a6184de Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 16 Mar 2019 13:03:50 +0800 Subject: *luax --- .../graphics/binding/canvas.binding.cpp | 0 Source/Asura.Engine/graphics/binding/canvas.cpp | 0 .../graphics/binding/color.binding.cpp | 0 Source/Asura.Engine/graphics/binding/color.cpp | 0 .../graphics/binding/image.binding.cpp | 0 Source/Asura.Engine/graphics/binding/image.cpp | 0 .../graphics/binding/image_data.binding.cpp | 35 ++++++ .../Asura.Engine/graphics/binding/image_data.cpp | 0 .../graphics/binding/mesh2d.binding.cpp | 0 Source/Asura.Engine/graphics/binding/mesh2d.cpp | 0 .../graphics/binding/mesh2d_data.binding.cpp | 0 .../Asura.Engine/graphics/binding/mesh2d_data.cpp | 0 .../graphics/binding/shader.binding.cpp | 119 +++++++++++++++++++++ Source/Asura.Engine/graphics/binding/shader.cpp | 119 --------------------- .../graphics/binding/sprite_batch.binding.cpp | 0 .../Asura.Engine/graphics/binding/sprite_batch.cpp | 0 .../graphics/binding/window.binding.cpp | 11 ++ Source/Asura.Engine/graphics/binding/window.cpp | 11 -- Source/Asura.Engine/graphics/image.h | 22 ++-- Source/Asura.Engine/graphics/shader.h | 6 ++ 20 files changed, 180 insertions(+), 143 deletions(-) create mode 100644 Source/Asura.Engine/graphics/binding/canvas.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/canvas.cpp create mode 100644 Source/Asura.Engine/graphics/binding/color.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/color.cpp create mode 100644 Source/Asura.Engine/graphics/binding/image.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/image.cpp create mode 100644 Source/Asura.Engine/graphics/binding/image_data.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/image_data.cpp create mode 100644 Source/Asura.Engine/graphics/binding/mesh2d.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/mesh2d.cpp create mode 100644 Source/Asura.Engine/graphics/binding/mesh2d_data.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/mesh2d_data.cpp create mode 100644 Source/Asura.Engine/graphics/binding/shader.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/shader.cpp create mode 100644 Source/Asura.Engine/graphics/binding/sprite_batch.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/sprite_batch.cpp create mode 100644 Source/Asura.Engine/graphics/binding/window.binding.cpp delete mode 100644 Source/Asura.Engine/graphics/binding/window.cpp (limited to 'Source/Asura.Engine/graphics') diff --git a/Source/Asura.Engine/graphics/binding/canvas.binding.cpp b/Source/Asura.Engine/graphics/binding/canvas.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/canvas.cpp b/Source/Asura.Engine/graphics/binding/canvas.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/color.binding.cpp b/Source/Asura.Engine/graphics/binding/color.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/color.cpp b/Source/Asura.Engine/graphics/binding/color.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/image.binding.cpp b/Source/Asura.Engine/graphics/binding/image.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/image.cpp b/Source/Asura.Engine/graphics/binding/image.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/image_data.binding.cpp b/Source/Asura.Engine/graphics/binding/image_data.binding.cpp new file mode 100644 index 0000000..d576718 --- /dev/null +++ b/Source/Asura.Engine/graphics/binding/image_data.binding.cpp @@ -0,0 +1,35 @@ +#include "../image.h" + +using namespace Luax; + +namespace AsuraEngine +{ + namespace Graphics + { + + void Image::RegisterLuaxInterface(LuaxState& state) + { + + } + + void Image::RegisterLuaxClass(LuaxState& state) + { + + } + + void Image::RegisterLuaxPostprocess(LuaxState& state) + { + // blend方法枚举,AsuraEngine.EBlendMode + LuaxEnum EBlendMode[] = { + { "Additive", 1 }, + { "PreBlend", 2 }, + { "Substruction", 3 }, + { "Multiplied", 4 }, + {0, 0} + }; + + state.RegisterEnum("EBlendMode", EBlendMode); + } + + } +} \ No newline at end of file diff --git a/Source/Asura.Engine/graphics/binding/image_data.cpp b/Source/Asura.Engine/graphics/binding/image_data.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/mesh2d.binding.cpp b/Source/Asura.Engine/graphics/binding/mesh2d.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/mesh2d.cpp b/Source/Asura.Engine/graphics/binding/mesh2d.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/mesh2d_data.binding.cpp b/Source/Asura.Engine/graphics/binding/mesh2d_data.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/mesh2d_data.cpp b/Source/Asura.Engine/graphics/binding/mesh2d_data.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/shader.binding.cpp b/Source/Asura.Engine/graphics/binding/shader.binding.cpp new file mode 100644 index 0000000..3f24bb7 --- /dev/null +++ b/Source/Asura.Engine/graphics/binding/shader.binding.cpp @@ -0,0 +1,119 @@ +#include "../Shader.h" + +using namespace Luax; + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// 将此shader设置为活动。 + /// + int Shader::l_Use(lua_State* L) + { + LUAX_STATE(L); + + } + + /// + /// 将此shader设置为非活动。 + /// + int Shader::l_Unuse(lua_State* L) + { + LUAX_STATE(L); + + } + + /// + /// 从着色器代码中构建shader程序。如果成功返回true,失败返回false。 + /// + int Shader::l_Load(lua_State* L) + { + LUAX_STATE(L); + + } + + /// + /// 判断shader是否有这个uniform,如果有返回true,否则返回false + /// + int Shader::l_HasUniform(lua_State* L) + { + LUAX_STATE(L); + + } + + /// + /// 后的uniforms的location,如果没有这个uniform,返回nil,否则返回对应的loc + /// + int Shader::l_GetUniformLocation(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetBuiltInUniforms(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformFloat(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformTexture(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformVector2(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformVector3(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformVector4(lua_State* L) + { + LUAX_STATE(L); + + } + + int Shader::l_SetUniformColor(lua_State* L) + { + LUAX_STATE(L); + + } + + void Shader::RegisterLuaxInterface(LuaxState& state) + { + + } + + void Shader::RegisterLuaxClass(LuaxState& state) + { + + LuaxEnum EBuiltIn[] = { + {0, 0} + }; + + state.RegisterEnum("EBuiltIn", EBuiltIn); + + } + + void Shader::RegisterLuaxPostprocess(LuaxState& state) + { + + } + + } +} \ No newline at end of file diff --git a/Source/Asura.Engine/graphics/binding/shader.cpp b/Source/Asura.Engine/graphics/binding/shader.cpp deleted file mode 100644 index 27ed856..0000000 --- a/Source/Asura.Engine/graphics/binding/shader.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "../Shader.h" - -using namespace Luax; - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 将此shader设置为活动。 - /// - int Shader::l_Use(lua_State* L) - { - LUAX_STATE(L); - - } - - /// - /// 将此shader设置为非活动。 - /// - int Shader::l_Unuse(lua_State* L) - { - LUAX_STATE(L); - - } - - /// - /// 从着色器代码中构建shader程序。如果成功返回true,失败返回false。 - /// - int Shader::l_Load(lua_State* L) - { - LUAX_STATE(L); - - } - - /// - /// 判断shader是否有这个uniform,如果有返回true,否则返回false - /// - int Shader::l_HasUniform(lua_State* L) - { - LUAX_STATE(L); - - } - - /// - /// 后的uniforms的location,如果没有这个uniform,返回nil,否则返回对应的loc - /// - int Shader::l_GetUniformLocation(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetBuiltInUniforms(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformFloat(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformTexture(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformVector2(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformVector3(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformVector4(lua_State* L) - { - LUAX_STATE(L); - - } - - int Shader::l_SetUniformColor(lua_State* L) - { - LUAX_STATE(L); - - } - - void Shader::RegisterLuaxClass(LuaxState& state) - { - - } - - void Shader::RegisterLuaxInterface(LuaxState& state) - { - - } - - void Shader::RegisterLuaxClass(LuaxState& state) - { - - LuaxEnum EBuiltIn[] = { - {0, 0} - }; - - state.RegisterEnum("EBuiltIn", EBuiltIn); - - } - - } -} \ No newline at end of file diff --git a/Source/Asura.Engine/graphics/binding/sprite_batch.binding.cpp b/Source/Asura.Engine/graphics/binding/sprite_batch.binding.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Engine/graphics/binding/sprite_batch.cpp b/Source/Asura.Engine/graphics/binding/sprite_batch.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Engine/graphics/binding/window.binding.cpp b/Source/Asura.Engine/graphics/binding/window.binding.cpp new file mode 100644 index 0000000..3befc8c --- /dev/null +++ b/Source/Asura.Engine/graphics/binding/window.binding.cpp @@ -0,0 +1,11 @@ +#include "../Window.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + + + } +} diff --git a/Source/Asura.Engine/graphics/binding/window.cpp b/Source/Asura.Engine/graphics/binding/window.cpp deleted file mode 100644 index 3befc8c..0000000 --- a/Source/Asura.Engine/graphics/binding/window.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../Window.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - - - } -} diff --git a/Source/Asura.Engine/graphics/image.h b/Source/Asura.Engine/graphics/image.h index 66c7ae1..2607969 100644 --- a/Source/Asura.Engine/graphics/image.h +++ b/Source/Asura.Engine/graphics/image.h @@ -1,14 +1,14 @@ #ifndef __ASURA_ENGINE_IMAGE_H__ #define __ASURA_ENGINE_IMAGE_H__ -#include "Math/Vector2.hpp" -#include "Scripting/Portable.h" -#include "FileSystem/Reloadable.h" -#include "StringMap.hpp" -#include "Manager.hpp" -#include "Texture.h" -#include "Color.h" -#include "ImageData.h" +#include "math/vector2.hpp" +#include "scripting/portable.h" +#include "fileSystem/reloadable.h" +#include "stringmap.hpp" +#include "manager.hpp" +#include "texture.h" +#include "color.h" +#include "image_data.h" namespace AsuraEngine { @@ -23,7 +23,7 @@ namespace AsuraEngine /// class Image ASURA_FINAL : public Drawable - , public Scripting::Portable + , public Scripting::Portable , public Filesystem::Reloadable { public: @@ -59,8 +59,6 @@ namespace AsuraEngine public: - //---------------------------------------------------------------------------------------------------------- - LUAX_DECL_FACTORY(SimImage); LUAX_DECL_METHOD(l_Load); @@ -68,8 +66,6 @@ namespace AsuraEngine LUAX_DECL_METHOD(l_GetHeight); LUAX_DECL_METHOD(l_GetSize); - //---------------------------------------------------------------------------------------------------------- - }; } diff --git a/Source/Asura.Engine/graphics/shader.h b/Source/Asura.Engine/graphics/shader.h index 7c00dda..4976106 100644 --- a/Source/Asura.Engine/graphics/shader.h +++ b/Source/Asura.Engine/graphics/shader.h @@ -94,6 +94,8 @@ namespace AsuraEngine /// GLuint mProgramHandle; + //------------------------------------------------------------------------------------------------------------ + public: LUAX_DECL_FACTORY(SimShader); @@ -111,6 +113,10 @@ namespace AsuraEngine LUAX_DECL_METHOD(l_SetUniformVector4); LUAX_DECL_METHOD(l_SetUniformColor); + private: + + Luax::LuaxMemberRef mCodeLuaRef; + }; } -- cgit v1.1-26-g67d0