diff options
| author | chai <chaifix@163.com> | 2018-07-28 00:50:12 +0800 |
|---|---|---|
| committer | chai <chaifix@163.com> | 2018-07-28 00:50:12 +0800 |
| commit | 92dab582ccac31be7fa410e7f4fb3789e88a0629 (patch) | |
| tree | 008bbecc76a73aae38d77d1851f4230756356a33 /src/lua/graphics | |
| parent | b855ebb91ad8d97617ec1aa418b4add84670a07d (diff) | |
*update
Diffstat (limited to 'src/lua/graphics')
| -rw-r--r-- | src/lua/graphics/luaopen_graphics.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lua/graphics/luaopen_graphics.cpp b/src/lua/graphics/luaopen_graphics.cpp index be40247..f0bae67 100644 --- a/src/lua/graphics/luaopen_graphics.cpp +++ b/src/lua/graphics/luaopen_graphics.cpp @@ -33,8 +33,12 @@ namespace lua 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); - luax_pushboolean(L, 1); + if (!wnd->init(&setting)) + { + luax_pushboolean(L, false); + return 1; + } + luax_pushboolean(L, true); return 1; } |
