From b2df3ae7c1bd33a92fc38c2f425a7242bfa93dd2 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 12 May 2023 00:35:22 -0500 Subject: add glDeleteProgram bind --- src/opengl/shader.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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; -- cgit v1.2.1