summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/opengl/shader.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/opengl/shader.c b/src/opengl/shader.c
index 061b814..203c790 100644
--- a/src/opengl/shader.c
+++ b/src/opengl/shader.c
@@ -11,6 +11,7 @@ int gl_shader_compile(lua_State *L);
int gl_shader_delete(lua_State *L);
int gl_program_create(lua_State *L);
+int glDeleteProgram_bind(lua_State *L);
int gl_program_attach_shader(lua_State *L);
int gl_program_link(lua_State *L);
int gl_program_use(lua_State *L);
@@ -34,6 +35,7 @@ void setup_shader(lua_State *L, int gl_index)
H_FUNC("DeleteShader", gl_shader_delete),
H_FUNC("CreateProgram", gl_program_create),
+ H_FUNC("DeleteProgram", glDeleteProgram_bind),
H_FUNC("AttachShader", gl_program_attach_shader),
H_FUNC("LinkProgram", gl_program_link),
H_FUNC("UseProgram", gl_program_use),
@@ -107,6 +109,14 @@ int gl_program_create(lua_State *L)
}
+int glDeleteProgram_bind(lua_State *L)
+{
+ int program = luaL_checkinteger(L, 1);
+ glDeleteProgram(program);
+ return 0;
+}
+
+
int gl_program_attach_shader(lua_State *L)
{
lua_Integer program, shader;