From 275536b36657744d802866c060654e2b5cd5a5f8 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 18 Aug 2022 22:46:40 -0500 Subject: implement working windows --- src/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index e69de29..a42e285 100644 --- a/src/main.c +++ b/src/main.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include "gl/gl.h" + + +int main(int argc, char **argv) +{ + lua_State *L = luaL_newstate(); + luaL_openlibs(L); + + lua_createtable(L, 0, 2); + int honey_index = lua_gettop(L); + setup_gl(L, honey_index); + setup_window(L, honey_index); + lua_setglobal(L, "honey"); + + int err = luaL_loadfile(L, "honey.lua"); + if (err != 0) { + printf("cannot open file!\n"); + lua_close(L); + return 0; + } + err = hs_call(L, 0, 0); + if (err != 0) { + const char *err_str = lua_tostring(L, -1); + printf("failed to run: %s\n", err_str); + } + lua_close(L); + return 0; +} -- cgit v1.2.1 From 899e70147ff7c866f131ba7bfb98193c4e68027f Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 19 Aug 2022 13:53:18 -0500 Subject: add shaders and basic drawing functions --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a42e285..c989dbd 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ int main(int argc, char **argv) err = hs_call(L, 0, 0); if (err != 0) { const char *err_str = lua_tostring(L, -1); - printf("failed to run: %s\n", err_str); + printf("failed to run: \n%s\n", err_str); } lua_close(L); return 0; -- cgit v1.2.1 From 1f47b685f35455afcc7441389cdc60018f66d159 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 15:55:44 -0500 Subject: add textures --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c989dbd..66b1f11 100644 --- a/src/main.c +++ b/src/main.c @@ -3,6 +3,7 @@ #include #include #include "gl/gl.h" +#include "image/image.h" int main(int argc, char **argv) @@ -14,6 +15,7 @@ int main(int argc, char **argv) int honey_index = lua_gettop(L); setup_gl(L, honey_index); setup_window(L, honey_index); + setup_image(L, honey_index); lua_setglobal(L, "honey"); int err = luaL_loadfile(L, "honey.lua"); -- cgit v1.2.1 From ae4e17fc743ca0344af818ab767db7311ea7829c Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 23 Aug 2022 13:28:01 -0500 Subject: add basic transforms --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 66b1f11..5f5d399 100644 --- a/src/main.c +++ b/src/main.c @@ -4,6 +4,7 @@ #include #include "gl/gl.h" #include "image/image.h" +#include "glm/glm.h" int main(int argc, char **argv) @@ -16,6 +17,7 @@ int main(int argc, char **argv) setup_gl(L, honey_index); setup_window(L, honey_index); setup_image(L, honey_index); + setup_glm(L, honey_index); lua_setglobal(L, "honey"); int err = luaL_loadfile(L, "honey.lua"); -- cgit v1.2.1