Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463)

This commit is contained in:
Bart van Strien
2013-03-10 23:00:31 +01:00
parent 63c57ba3f8
commit 7efe11b11f
7 changed files with 39 additions and 3 deletions
@@ -94,6 +94,7 @@ int w_setMode(lua_State *L)
flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
flags.resizable = luax_boolflag(L, 3, "resizable", false);
flags.borderless = luax_boolflag(L, 3, "borderless", false);
flags.centered = luax_boolflag(L, 3, "centered", true);
luax_pushboolean(L, instance->setMode(w, h, &flags));
return 1;
@@ -124,6 +125,9 @@ int w_getMode(lua_State *L)
luax_pushboolean(L, flags.borderless);
lua_setfield(L, -2, "borderless");
luax_pushboolean(L, flags.centered);
lua_setfield(L, -2, "centered");
return 3;
}