diff options
author | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
commit | 66c5fdc564dd892ed265132d6c1378dbe3cebcee (patch) | |
tree | 909848ed622b35c8653c961c9ebed8c574bb150e /source/libs/asura-lib-core/graphics/binding | |
parent | d9041d6e12ded456c17622f7f2e7bbacb9e99b1a (diff) |
*misc
Diffstat (limited to 'source/libs/asura-lib-core/graphics/binding')
11 files changed, 371 insertions, 89 deletions
diff --git a/source/libs/asura-lib-core/graphics/binding/_canvas.cpp b/source/libs/asura-lib-core/graphics/binding/_canvas.cpp index e69de29..7927995 100644 --- a/source/libs/asura-lib-core/graphics/binding/_canvas.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_canvas.cpp @@ -0,0 +1,46 @@ +#include "../canvas.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Canvas) + { + LUAX_REGISTER_METHODS(state, + { "SetSize", _SetSize }, + { "Bind", _Bind }, + { "Unbind", _Unbind } + ); + } + + LUAX_POSTPROCESS(Canvas) + { + + } + + // canvas:SetSize() + LUAX_IMPL_METHOD(Canvas, _SetSize) + { + LUAX_PREPARE(L, Canvas); + + } + + // canvas:Bind() + LUAX_IMPL_METHOD(Canvas, _Bind) + { + LUAX_PREPARE(L, Canvas); + + } + + // canvas:Unbind() + LUAX_IMPL_METHOD(Canvas, _Unbind) + { + LUAX_PREPARE(L, Canvas); + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_color.cpp b/source/libs/asura-lib-core/graphics/binding/_color.cpp index e69de29..11e80a1 100644 --- a/source/libs/asura-lib-core/graphics/binding/_color.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_color.cpp @@ -0,0 +1,54 @@ +#include "../color.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Color) + { + LUAX_REGISTER_METHODS(state, + { "ToColor32", _ToColor32 }, + { "SetColor", _SetColor }, + { "GetColor", _GetColor }, + { "Multiply", _Multiply } + ); + } + + LUAX_POSTPROCESS(Color) + { + + } + + // color:ToColor32() + LUAX_IMPL_METHOD(Color, _ToColor32) + { + LUAX_PREPARE(L, Color); + + } + + // color:SetColor() + LUAX_IMPL_METHOD(Color, _SetColor) + { + LUAX_PREPARE(L, Color); + + } + + // color:GetColor() + LUAX_IMPL_METHOD(Color, _GetColor) + { + LUAX_PREPARE(L, Color); + + } + + // color:Multiply() + LUAX_IMPL_METHOD(Color, _Multiply) + { + LUAX_PREPARE(L, Color); + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_color32.cpp b/source/libs/asura-lib-core/graphics/binding/_color32.cpp new file mode 100644 index 0000000..7095866 --- /dev/null +++ b/source/libs/asura-lib-core/graphics/binding/_color32.cpp @@ -0,0 +1,86 @@ +#include "../color32.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Color32) + { + LUAX_REGISTER_METHODS(state, + { "ToColor", _ToColor }, + { "GetRed", _GetRed }, + { "GetGreen", _GetGreen }, + { "GetBlue", _GetBlue }, + { "GetAlpha", _GetAlpha }, + { "Multiply", _Multiply }, + { "Index", _Index }, + { "NewIndex", _NewIndex } + ); + } + + LUAX_POSTPROCESS(Color32) + { + + } + + // color32:ToColor() + LUAX_IMPL_METHOD(Color32, _ToColor) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:GetRed() + LUAX_IMPL_METHOD(Color32, _GetRed) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:GetGreen() + LUAX_IMPL_METHOD(Color32, _GetGreen) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:GetBlue() + LUAX_IMPL_METHOD(Color32, _GetBlue) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:GetAlpha() + LUAX_IMPL_METHOD(Color32, _GetAlpha) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:Multiply() + LUAX_IMPL_METHOD(Color32, _Multiply) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:Index() + LUAX_IMPL_METHOD(Color32, _Index) + { + LUAX_PREPARE(L, Color32); + + } + + // color32:NewIndex() + LUAX_IMPL_METHOD(Color32, _NewIndex) + { + LUAX_PREPARE(L, Color32); + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_gif.cpp b/source/libs/asura-lib-core/graphics/binding/_gif.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/libs/asura-lib-core/graphics/binding/_gif.cpp +++ /dev/null diff --git a/source/libs/asura-lib-core/graphics/binding/_image.cpp b/source/libs/asura-lib-core/graphics/binding/_image.cpp index e69de29..7c1034c 100644 --- a/source/libs/asura-lib-core/graphics/binding/_image.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_image.cpp @@ -0,0 +1,54 @@ +#include "../image.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Image) + { + LUAX_REGISTER_METHODS(state, + { "Load", _Load }, + { "GetWidth", _GetWidth }, + { "GetHeight", _GetHeight }, + { "GetSize", _GetSize } + ); + } + + LUAX_POSTPROCESS(Image) + { + + } + + // image:Load() + LUAX_IMPL_METHOD(Image, _Load) + { + LUAX_PREPARE(L, Image); + + } + + // image:GetWidth() + LUAX_IMPL_METHOD(Image, _GetWidth) + { + LUAX_PREPARE(L, Image); + + } + + // image:GetHeight() + LUAX_IMPL_METHOD(Image, _GetHeight) + { + LUAX_PREPARE(L, Image); + + } + + // image:GetSize() + LUAX_IMPL_METHOD(Image, _GetSize) + { + LUAX_PREPARE(L, Image); + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_image_data.cpp b/source/libs/asura-lib-core/graphics/binding/_image_data.cpp index 72e33da..3ff38f9 100644 --- a/source/libs/asura-lib-core/graphics/binding/_image_data.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_image_data.cpp @@ -1,62 +1,70 @@ #include "../image_data.h" -using namespace Luax; +using namespace std; -namespace AsuraEngine +namespace AsuraEngine { - namespace Graphics + namespace Graphics { - + LUAX_REGISTRY(ImageData) { - + LUAX_REGISTER_METHODS(state, + { "New", _New }, + { "GetPixel", _GetPixel }, + { "GetSize", _GetSize }, + { "GetWidth", _GetWidth }, + { "GetHeight", _GetHeight }, + { "GetPixelFormat", _GetPixelFormat } + ); } LUAX_POSTPROCESS(ImageData) { - LUAX_REGISTER_ENUM(state, "EBlendMode", - { "Additive", 1 } - ); - LUAX_REGISTER_ENUM(state, "EPixelFormat", - { "RGBA32", 1 } - ); + } - // imagedata = ImageData.New(databuffer) + // ImageData.New() LUAX_IMPL_METHOD(ImageData, _New) { LUAX_STATE(L); - Filesystem::DataBuffer* db = state.CheckUserdata<Filesystem::DataBuffer>(1); - ImageData* image = new ImageData(*db); - image->PushLuaxUserdata(state); - return 1; } + // imagedata:GetPixel() LUAX_IMPL_METHOD(ImageData, _GetPixel) { + LUAX_PREPARE(L, ImageData); } + // imagedata:GetSize() LUAX_IMPL_METHOD(ImageData, _GetSize) { + LUAX_PREPARE(L, ImageData); } + // imagedata:GetWidth() LUAX_IMPL_METHOD(ImageData, _GetWidth) { + LUAX_PREPARE(L, ImageData); } + // imagedata:GetHeight() LUAX_IMPL_METHOD(ImageData, _GetHeight) { + LUAX_PREPARE(L, ImageData); } + // imagedata:GetPixelFormat() LUAX_IMPL_METHOD(ImageData, _GetPixelFormat) { + LUAX_PREPARE(L, ImageData); } } -}
\ No newline at end of file +} diff --git a/source/libs/asura-lib-core/graphics/binding/_mesh2d.cpp b/source/libs/asura-lib-core/graphics/binding/_mesh2d.cpp index e69de29..07e9f12 100644 --- a/source/libs/asura-lib-core/graphics/binding/_mesh2d.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_mesh2d.cpp @@ -0,0 +1,21 @@ +#include "../mesh2d.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Mesh2D) + { + + } + + LUAX_POSTPROCESS(Mesh2D) + { + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_mesh2d_data.cpp b/source/libs/asura-lib-core/graphics/binding/_mesh2d_data.cpp deleted file mode 100644 index 6e15052..0000000 --- a/source/libs/asura-lib-core/graphics/binding/_mesh2d_data.cpp +++ /dev/null @@ -1,9 +0,0 @@ -namespace AsuraEngine -{ - namespace Graphics - { - - - - } -}
\ No newline at end of file diff --git a/source/libs/asura-lib-core/graphics/binding/_shader.cpp b/source/libs/asura-lib-core/graphics/binding/_shader.cpp index 2f2f507..a06e54b 100644 --- a/source/libs/asura-lib-core/graphics/binding/_shader.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_shader.cpp @@ -1,114 +1,126 @@ #include "../shader.h" -using namespace Luax; +using namespace std; -namespace AsuraEngine +namespace AsuraEngine { - namespace Graphics + namespace Graphics { - - void Shader::RegisterLuaxClass(LuaxState& state) + + LUAX_REGISTRY(Shader) { + LUAX_REGISTER_METHODS(state, + { "New", _New }, + { "Use", _Use }, + { "Unuse", _Unuse }, + { "Load", _Load }, + { "HasUniform", _HasUniform }, + { "GetUniformLocation", _GetUniformLocation }, + { "SetBuiltInUniforms", _SetBuiltInUniforms }, + { "SetUniformFloat", _SetUniformFloat }, + { "SetUniformTexture", _SetUniformTexture }, + { "SetUniformVector2", _SetUniformVector2 }, + { "SetUniformVector3", _SetUniformVector3 }, + { "SetUniformVector4", _SetUniformVector4 }, + { "SetUniformColor", _SetUniformColor } + ); + } - LuaxEnum EBuiltIn[] = { - {0, 0} - }; - - state.RegisterEnum("EBuiltIn", EBuiltIn); + LUAX_POSTPROCESS(Shader) + { } - void Shader::RegisterLuaxPostprocess(LuaxState& state) + // Shader.New() + LUAX_IMPL_METHOD(Shader, _New) { + LUAX_STATE(L); } - /// - /// shaderΪ - /// - int Shader::l_Use(lua_State* L) + // shader:Use() + LUAX_IMPL_METHOD(Shader, _Use) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - /// - /// shaderΪǻ - /// - int Shader::l_Unuse(lua_State* L) + // shader:Unuse() + LUAX_IMPL_METHOD(Shader, _Unuse) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - /// - /// ɫйshaderɹtrueʧܷfalse - /// - int Shader::l_Load(lua_State* L) + // shader:Load() + LUAX_IMPL_METHOD(Shader, _Load) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - /// - /// жshaderǷuniformзtrue,false - /// - int Shader::l_HasUniform(lua_State* L) + // shader:HasUniform() + LUAX_IMPL_METHOD(Shader, _HasUniform) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - /// - /// uniformslocationûuniformnilضӦloc - /// - int Shader::l_GetUniformLocation(lua_State* L) + // shader:GetUniformLocation() + LUAX_IMPL_METHOD(Shader, _GetUniformLocation) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetBuiltInUniforms(lua_State* L) + // shader:SetBuiltInUniforms() + LUAX_IMPL_METHOD(Shader, _SetBuiltInUniforms) { - LUAX_STATE(L); - + LUAX_PREPARE(L, Shader); + } - int Shader::l_SetUniformFloat(lua_State* L) + // shader:SetUniformFloat() + LUAX_IMPL_METHOD(Shader, _SetUniformFloat) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetUniformTexture(lua_State* L) + // shader:SetUniformTexture() + LUAX_IMPL_METHOD(Shader, _SetUniformTexture) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetUniformVector2(lua_State* L) + // shader:SetUniformVector2() + LUAX_IMPL_METHOD(Shader, _SetUniformVector2) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetUniformVector3(lua_State* L) + // shader:SetUniformVector3() + LUAX_IMPL_METHOD(Shader, _SetUniformVector3) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetUniformVector4(lua_State* L) + // shader:SetUniformVector4() + LUAX_IMPL_METHOD(Shader, _SetUniformVector4) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } - int Shader::l_SetUniformColor(lua_State* L) + // shader:SetUniformColor() + LUAX_IMPL_METHOD(Shader, _SetUniformColor) { - LUAX_STATE(L); + LUAX_PREPARE(L, Shader); } } -}
\ No newline at end of file +} diff --git a/source/libs/asura-lib-core/graphics/binding/_sprite_batch.cpp b/source/libs/asura-lib-core/graphics/binding/_sprite_batch.cpp index e69de29..8556c02 100644 --- a/source/libs/asura-lib-core/graphics/binding/_sprite_batch.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_sprite_batch.cpp @@ -0,0 +1,21 @@ +#include "../sprite_batch.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(SpriteBatch) + { + + } + + LUAX_POSTPROCESS(SpriteBatch) + { + + } + + } +} diff --git a/source/libs/asura-lib-core/graphics/binding/_window.cpp b/source/libs/asura-lib-core/graphics/binding/_window.cpp deleted file mode 100644 index 3befc8c..0000000 --- a/source/libs/asura-lib-core/graphics/binding/_window.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../Window.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - - - } -} |