From 8bb877ad57e7e41d928408e81f4e8cca63e171f7 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sun, 1 Nov 2020 13:04:05 -0600 Subject: add basic node types --- src/honey.c | 13 +++++++++++++ src/texture/texture.c | 2 ++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/honey.c b/src/honey.c index ce1a38c..4ffb83f 100644 --- a/src/honey.c +++ b/src/honey.c @@ -95,6 +95,16 @@ int honey_lua_enable_depth_test(lua_State* L) return 0; } +int honey_lua_set_viewport_size(lua_State* L) +{ + int width, height; + honey_lua_parse_arguments(L, 2, + HONEY_INTEGER, &width, + HONEY_INTEGER, &height); + glViewport(0,0,width,height); + return 0; +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ bool honey_setup(lua_State** L) @@ -139,6 +149,9 @@ bool honey_setup(lua_State** L) lua_pushcfunction(*L, honey_lua_enable_depth_test); lua_setfield(*L, -2, "enable_depth_test"); + lua_pushcfunction(*L, honey_lua_set_viewport_size); + lua_setfield(*L, -2, "set_viewport_size"); + lua_setglobal(*L, "honey"); return true; diff --git a/src/texture/texture.c b/src/texture/texture.c index 9ddf441..37e38e9 100644 --- a/src/texture/texture.c +++ b/src/texture/texture.c @@ -246,6 +246,8 @@ void honey_texture_framebuffer_object_new(unsigned int* destination, honey_texture* depth, int width, int height) { + glBindTexture(GL_TEXTURE_2D, 0); + glGenFramebuffers(1, destination); glBindFramebuffer(GL_FRAMEBUFFER, *destination); -- cgit v1.2.1