summaryrefslogtreecommitdiff
path: root/src/gl/drawing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gl/drawing.c')
-rw-r--r--src/gl/drawing.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gl/drawing.c b/src/gl/drawing.c
index a64f56d..ca914e0 100644
--- a/src/gl/drawing.c
+++ b/src/gl/drawing.c
@@ -5,6 +5,7 @@
int gl_set_viewport(lua_State *L);
int gl_draw_arrays(lua_State *L);
+int gl_draw_elements(lua_State *L);
int gl_set_clear_color(lua_State *L);
int gl_clear(lua_State *L);
@@ -24,6 +25,7 @@ void setup_drawing(lua_State *L, int gl_index)
hs_create_table(L,
hs_str_cfunc("drawArrays", gl_draw_arrays),
+ hs_str_cfunc("drawElements", gl_draw_elements),
hs_str_cfunc("setClearColor", gl_set_clear_color),
hs_str_cfunc("clear", gl_clear),
hs_str_cfunc("setViewport", gl_set_viewport),
@@ -62,6 +64,15 @@ int gl_draw_arrays(lua_State *L)
}
+int gl_draw_elements(lua_State *L)
+{
+ lua_Integer mode, count, type, offset;
+ hs_parse_args(L, hs_int(mode), hs_int(count), hs_int(type), hs_int(offset));
+ glDrawElements(mode, count, type, (const void*)offset);
+ return 0;
+}
+
+
int gl_set_viewport(lua_State *L)
{
lua_Integer x, y, w, h;