From 5c9af043503f92852a1a765b6ecfbc1aea24d2e9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 14 Aug 2018 14:56:47 +0800 Subject: *update --- src/lua/graphics/luaopen_JSL.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lua/graphics/luaopen_JSL.cpp') diff --git a/src/lua/graphics/luaopen_JSL.cpp b/src/lua/graphics/luaopen_JSL.cpp index 8d25178..774f2b6 100644 --- a/src/lua/graphics/luaopen_JSL.cpp +++ b/src/lua/graphics/luaopen_JSL.cpp @@ -1,13 +1,16 @@ #include "lua/luax.h" -#include "libjin/jin.h" #include "lua/luaopen_types.h" +#include "Image.h" +#include "JSL.h" +#include "Canvas.h" +#include "Color.h" namespace jin { namespace lua { - - using namespace jin::graphics; + + using namespace lua::graphics; static inline JSLProgram* checkJSLProgram(lua_State* L) { @@ -67,8 +70,8 @@ namespace lua case IMAGE: { Proxy* proxy = (Proxy*)luax_checktype(L, 4, JIN_GRAPHICS_IMAGE); - Texture* tex = (Texture*)proxy->object; - jsl->sendTexture(variable, tex); + Image* tex = (Image*)proxy->object; + jsl->sendImage(variable, tex); break; } case CANVAS: @@ -122,8 +125,7 @@ namespace lua static int l_gc(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SHADER); - JSLProgram* jsl = (JSLProgram*)proxy->object; - delete jsl; + proxy->release(); return 0; } -- cgit v1.1-26-g67d0