#include #include #include #include "setup.h" int glfwMakeContextCurrent_bind(lua_State *L) { GLFWwindow ** window = luaL_checkudata(L, 1, glfw_window_tname); glfwMakeContextCurrent(*window); return 0; } int glfwGetCurrentContext_bind(lua_State *L) { GLFWwindow * bind_result = glfwGetCurrentContext(); struct h_glfw_window_data_t *data = glfwGetWindowUserPointer(bind_result); lua_rawgeti(L, LUA_REGISTRYINDEX, data->self_ref); return 1; } int glfwSwapInterval_bind(lua_State *L) { int interval = luaL_checkinteger(L, 1); glfwSwapInterval(interval); return 0; } int glfwExtensionSupported_bind(lua_State *L) { const char * extension = luaL_checkstring(L, 1); int bind_result = glfwExtensionSupported(extension); lua_pushinteger(L, bind_result); return 1; } int glfwGetProcAddress_bind(lua_State *L) { const char * procname = luaL_checkstring(L, 1); GLFWglproc bind_result = glfwGetProcAddress(procname); lua_pushlightuserdata(L, bind_result); return 1; }