summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-11-01 13:04:05 -0600
committersanine-a <sanine.not@pm.me>2020-11-01 13:04:05 -0600
commit8bb877ad57e7e41d928408e81f4e8cca63e171f7 (patch)
tree5cc4a79a492bd3c7224070b3bd00aba512a9b053 /src
parentcf75cc42cd11c31ff9402751bec98ba607fd820f (diff)
add basic node types
Diffstat (limited to 'src')
-rw-r--r--src/honey.c13
-rw-r--r--src/texture/texture.c2
2 files changed, 15 insertions, 0 deletions
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);