diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/texture.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/opengl/texture.c b/src/opengl/texture.c index 13b23c0..a1fda90 100644 --- a/src/opengl/texture.c +++ b/src/opengl/texture.c @@ -6,6 +6,7 @@ int gl_texture_create(lua_State *L); +int glDeleteTextures_bind(lua_State *L); int gl_texture_bind(lua_State *L); int gl_texture_image_2d(lua_State *L); int gl_texture_generate_mipmaps(lua_State *L); @@ -18,6 +19,7 @@ void setup_texture(lua_State *L, int gl_index) struct honey_tbl_t tbl[] = { /* functions */ H_FUNC("GenTextures", gl_texture_create), + H_FUNC("DeleteTextures", glDeleteTextures_bind), H_FUNC("BindTexture", gl_texture_bind), H_FUNC("TexImage2D", gl_texture_image_2d), H_FUNC("GenerateMipmap", gl_texture_generate_mipmaps), @@ -74,6 +76,14 @@ int gl_texture_create(lua_State *L) } +int glDeleteTextures_bind(lua_State *L) +{ + GLuint texture = luaL_checkinteger(L, 1); + glDeleteTextures(1, &texture); + return 0; +} + + int gl_texture_bind(lua_State *L) { lua_Integer target, texture; |