From 82956beb1fe17e1226327638c8ab22b5f5adfc1d Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 20 Mar 2019 22:43:25 +0800 Subject: *misc --- .../graphics/binding/image_data.binding.cpp | 56 +++++++++++++++++----- 1 file changed, 44 insertions(+), 12 deletions(-) (limited to 'source/libs/asura-lib-core/graphics/binding') diff --git a/source/libs/asura-lib-core/graphics/binding/image_data.binding.cpp b/source/libs/asura-lib-core/graphics/binding/image_data.binding.cpp index 0d68c11..72e33da 100644 --- a/source/libs/asura-lib-core/graphics/binding/image_data.binding.cpp +++ b/source/libs/asura-lib-core/graphics/binding/image_data.binding.cpp @@ -1,4 +1,4 @@ -#include "../image.h" +#include "../image_data.h" using namespace Luax; @@ -7,23 +7,55 @@ namespace AsuraEngine namespace Graphics { - void Image::RegisterLuaxClass(LuaxState& state) + LUAX_REGISTRY(ImageData) { } - void Image::RegisterLuaxPostprocess(LuaxState& state) + LUAX_POSTPROCESS(ImageData) + { + LUAX_REGISTER_ENUM(state, "EBlendMode", + { "Additive", 1 } + ); + LUAX_REGISTER_ENUM(state, "EPixelFormat", + { "RGBA32", 1 } + ); + } + + // imagedata = ImageData.New(databuffer) + LUAX_IMPL_METHOD(ImageData, _New) + { + LUAX_STATE(L); + + Filesystem::DataBuffer* db = state.CheckUserdata(1); + ImageData* image = new ImageData(*db); + image->PushLuaxUserdata(state); + return 1; + } + + LUAX_IMPL_METHOD(ImageData, _GetPixel) + { + + } + + LUAX_IMPL_METHOD(ImageData, _GetSize) + { + + } + + LUAX_IMPL_METHOD(ImageData, _GetWidth) + { + + } + + LUAX_IMPL_METHOD(ImageData, _GetHeight) + { + + } + + LUAX_IMPL_METHOD(ImageData, _GetPixelFormat) { - // blend·½·¨Ã¶¾Ù£¬AsuraEngine.EBlendMode - LuaxEnum EBlendMode[] = { - { "Additive", 1 }, - { "PreBlend", 2 }, - { "Substruction", 3 }, - { "Multiplied", 4 }, - {0, 0} - }; - state.RegisterEnum("EBlendMode", EBlendMode); } } -- cgit v1.1-26-g67d0