static int l_window_hide(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutHideWindow(); return 0; }
static int l_window_iconify(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutIconifyWindow(); return 0; }
static int l_window_fullscreen(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutFullScreen(); return 0; }
static int l_window_show(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutShowWindow(); return 0; }
static int l_window_swap(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutSwapBuffers(); return 0; }
static int l_window_redraw(lua_State* L) { Window* win = l_checkWindow(L, 1); glutSetWindow(win->id); glutPostRedisplay(); return 0; }
static int l_window_destroy(lua_State* L) { Window* win = l_checkWindow(L, 1); glutDestroyWindow(win->id); win->id = -1; return 0; }
static int l_window___gc(lua_State* L) { Window* win = l_checkWindow(L, 1); if (win->id > -1) l_window_destroy(L); return 0; }
static int l_window_cursor(lua_State* L) { Window* win = l_checkWindow(L, 1); int cursor = luaL_checkinteger(L, 2); glutSetWindow(win->id); glutSetCursor(cursor); return 0; }
static int l_window_title(lua_State* L) { Window* win = l_checkWindow(L, 1); const char* title = luaL_checkstring(L, 2); glutSetWindow(win->id); glutSetWindowTitle(title); return 0; }
static int l_window_resize(lua_State* L) { Window* win = l_checkWindow(L, 1); int w = luaL_checkinteger(L, 2); int h = luaL_checkinteger(L, 3); glutSetWindow(win->id); glutReshapeWindow(w,h); return 0; }
static int l_window_position(lua_State* L) { Window* win = l_checkWindow(L, 1); int x = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 3); glutSetWindow(win->id); glutPositionWindow(x, y); return 0; }
static int l_window_free(lua_State *L) { SDL_Window *window; window = l_checkWindow(L, 1); SDL_DestroyWindow(window); return 0; }