static int Ltimer_cancel(lua_State *L) { lzn_Timer *obj = (lzn_Timer*)lbind_check(L, 1, &lbT_Timer); if (!obj->timer) return 0; lzn_unref(L, &obj->ref); zn_canceltimer(obj->timer); lbind_returnself(L); }
static int Ltimer_start(lua_State *L) { lzn_Timer *obj = (lzn_Timer*)lbind_check(L, 1, &lbT_Timer); lua_Integer delayms = luaL_optinteger(L, 2, 0); if (!obj->timer) return 0; if (delayms < 0) delayms = 0; obj->delayms = (unsigned)delayms; if (zn_starttimer(obj->timer, obj->delayms)) lzn_ref(L, 1, &obj->ref); lbind_returnself(L); }
static int Lwin_swapbuffers(lua_State *L) { GLFWwindow *win = (GLFWwindow*)lbind_check(L, 1, &lbT_Window); glfwSwapBuffers(win); lbind_returnself(L); }
static int Lwin_makecurrent(lua_State *L) { GLFWwindow *win = (GLFWwindow*)lbind_check(L, 1, &lbT_Window); glfwMakeContextCurrent(win); lbind_returnself(L); }
static int Lwin_restore(lua_State *L) { GLFWwindow *win = (GLFWwindow*)lbind_check(L, 1, &lbT_Window); glfwRestoreWindow(win); lbind_returnself(L); }
static int Lwin_iconify(lua_State *L) { GLFWwindow *win = (GLFWwindow*)lbind_check(L, 1, &lbT_Window); glfwIconifyWindow(win); lbind_returnself(L); }
static int Lwin_show(lua_State *L) { GLFWwindow *win = (GLFWwindow*)lbind_check(L, 1, &lbT_Window); glfwShowWindow(win); lbind_returnself(L); }