diff options
author | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
commit | adfda73e1810973a40b7bedd9a8edc3e7ab89e3c (patch) | |
tree | 3ee6b9ad4f3c71b5cefc719c694e7a80f3df7088 /src/script/graphics/luaopen_graphics.cpp | |
parent | 3ce3b10167a98f45614408a8042a10c686f3a9cc (diff) |
增加子系统基类
Diffstat (limited to 'src/script/graphics/luaopen_graphics.cpp')
-rw-r--r-- | src/script/graphics/luaopen_graphics.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/script/graphics/luaopen_graphics.cpp b/src/script/graphics/luaopen_graphics.cpp index 6e78e36..948e28a 100644 --- a/src/script/graphics/luaopen_graphics.cpp +++ b/src/script/graphics/luaopen_graphics.cpp @@ -30,15 +30,12 @@ namespace lua static int l_init(lua_State* L) { Window* wnd = Window::get(); - Window::Setting setting; + WindowSetting setting; setting.width = luax_getfield_integer(L, 1, "width"); setting.height = luax_getfield_integer(L, 1, "height"); setting.title = luax_getfield_string(L, 1, "title"); setting.vsync = luax_getfield_bool(L, 1, "vsync"); - wnd->init(setting); - - // init success - luax_pushboolean(L, true); + luax_pushboolean(L, wnd->init(&setting)); return 1; } @@ -357,8 +354,8 @@ namespace lua int tn = luax_tableidxlen(L, 3); if (tn != n * 2) { - static char emsg[] = - "number of polygon vertices doesn't match " + static char* emsg = \ + "number of polygon vertices doesn't match " \ "provided n, expect %d numbers but get %d"; luax_error(L, emsg, n * 2, tn); return 1; |