summaryrefslogtreecommitdiff
path: root/src/opengl/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/data.c')
-rw-r--r--src/opengl/data.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/opengl/data.c b/src/opengl/data.c
index b7dc581..bda8881 100644
--- a/src/opengl/data.c
+++ b/src/opengl/data.c
@@ -8,10 +8,12 @@
#include "gl.h"
int gl_create_buffer(lua_State *L);
+int glDeleteBuffers_bind(lua_State *L);
int gl_bind_buffer(lua_State *L);
int gl_buffer_data(lua_State *L);
int gl_vertex_array_create(lua_State *L);
+int glDeleteVertexArrays_bind(lua_State *L);
int gl_vertex_array_bind(lua_State *L);
int gl_vertex_attrib_pointer(lua_State *L);
int gl_vertex_array_enable_attrib(lua_State *L);
@@ -22,10 +24,12 @@ void setup_data(lua_State *L, int gl_index)
struct honey_tbl_t tbl[] = {
/* functions */
H_FUNC("GenBuffers", gl_create_buffer),
+ H_FUNC("DeleteBuffers", glDeleteBuffers_bind),
H_FUNC("BindBuffer", gl_bind_buffer),
H_FUNC("BufferData", gl_buffer_data),
H_FUNC("GenVertexArrays", gl_vertex_array_create),
+ H_FUNC("DeleteVertexArrays", glDeleteVertexArrays_bind),
H_FUNC("BindVertexArray", gl_vertex_array_bind),
H_FUNC("VertexAttribPointer", gl_vertex_attrib_pointer),
H_FUNC("EnableVertexAttribArray", gl_vertex_array_enable_attrib),
@@ -57,6 +61,14 @@ int gl_create_buffer(lua_State *L)
}
+int glDeleteBuffers_bind(lua_State *L)
+{
+ int buf = luaL_checkinteger(L, 1);
+ glDeleteBuffers(1, &buf);
+ return 1;
+}
+
+
int gl_bind_buffer(lua_State *L)
{
int target = luaL_checkinteger(L, 1);
@@ -131,6 +143,14 @@ int gl_vertex_array_create(lua_State *L)
}
+int glDeleteVertexArrays_bind(lua_State *L)
+{
+ int array = luaL_checkinteger(L, 1);
+ glDeleteVertexArrays(1, &array);
+ return 1;
+}
+
+
int gl_vertex_array_bind(lua_State *L)
{
lua_Integer array = luaL_checkinteger(L, 1);