diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/honey.c | 13 | ||||
-rw-r--r-- | src/texture/texture.c | 2 |
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); |