summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-05-12 00:35:22 -0500
committersanine <sanine.not@pm.me>2023-05-12 00:35:22 -0500
commitb2df3ae7c1bd33a92fc38c2f425a7242bfa93dd2 (patch)
treed3a5e8561ae30336d0d260331c3b9b97f040c415
parent5fc7e7a76086809b3817b9eac627f65441790b0d (diff)
add glDeleteProgram bind
-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;