diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/gl/honey_gl.h | 1 | ||||
-rw-r--r-- | src/gl/honey_window.c (renamed from src/gl/honey_gl.c) | 0 | ||||
-rw-r--r-- | src/main.c | 7 |
4 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e06dd85..507e2e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(${SRC_ROOT}/mesh/assimp-master) set(HONEY_LIB_FILES ${SRC_ROOT}/logging/logging.c - ${SRC_ROOT}/gl/honey_gl.c + ${SRC_ROOT}/gl/honey_window.c ${SRC_ROOT}/options/honey_options.c ) diff --git a/src/gl/honey_gl.h b/src/gl/honey_gl.h index 8d5cdd9..08210a0 100644 --- a/src/gl/honey_gl.h +++ b/src/gl/honey_gl.h @@ -13,5 +13,6 @@ struct honey_window { extern struct honey_window window; void setup_window(lua_State *L, int tbl_index); +void setup_gl(lua_State *L, int tbl_index); #endif diff --git a/src/gl/honey_gl.c b/src/gl/honey_window.c index 6a113d1..6a113d1 100644 --- a/src/gl/honey_gl.c +++ b/src/gl/honey_window.c @@ -41,15 +41,16 @@ int main(int argc, char **argv) /* load main script */ honey_debug("loading '%s'\n", options.main_script); - if (luaL_loadfile(L, options.main_script)) { + if (luaL_loadfile(L, options.main_script) != 0) { const char *error = lua_tostring(L, -1); honey_fatal("%s\n", error); return 1; } - if (!hs_call(L, 0, 0)) { + if (hs_call(L, 0, 0) != 0) { + honey_debug("stack size: %d\n", lua_gettop(L)); const char *error = lua_tostring(L, -1); - honey_fatal("unhandled error: %s", error); + honey_fatal("error loading main file: %s\n", error); goto close; /* sorry */ } |