aboutsummaryrefslogtreecommitdiff
path: root/src/script/graphics/luaopen_graphics.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-05-20 23:37:11 +0800
committerchai <chaifix@163.com>2018-05-20 23:37:11 +0800
commit51ba9cb2a6b0b9395a2912eadeb954c95e4c1d3c (patch)
tree58ce7d8b50c0d9a451d26bf0b3230b1c2e2f2782 /src/script/graphics/luaopen_graphics.cpp
parentadfda73e1810973a40b7bedd9a8edc3e7ab89e3c (diff)
修改目录结构
Diffstat (limited to 'src/script/graphics/luaopen_graphics.cpp')
-rw-r--r--src/script/graphics/luaopen_graphics.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/graphics/luaopen_graphics.cpp b/src/script/graphics/luaopen_graphics.cpp
index 948e28a..40bdaa1 100644
--- a/src/script/graphics/luaopen_graphics.cpp
+++ b/src/script/graphics/luaopen_graphics.cpp
@@ -38,6 +38,13 @@ namespace lua
luax_pushboolean(L, wnd->init(&setting));
return 1;
}
+
+ static int l_destroy(lua_State* L)
+ {
+ Window* wnd = Window::get();
+ wnd->quit();
+ return 0;
+ }
/**
* Get windows size.
@@ -488,6 +495,8 @@ namespace lua
{"circle", l_drawCircle},
{"triangle", l_drawTriangle},
{"polygon", l_drawPolygon},
+ //
+ {"destroy", l_destroy},
{0, 0}
};