diff options
-rw-r--r-- | demo/honey.lua | 2 | ||||
-rw-r--r-- | src/gl/gl.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/demo/honey.lua b/demo/honey.lua index 489f022..15acbf2 100644 --- a/demo/honey.lua +++ b/demo/honey.lua @@ -75,7 +75,7 @@ gl.bindVertexArray(vertexArray) gl.bindBuffer(gl.bufferTarget.arrayBuffer, vertexBuffer) local err = gl.getError() if err ~= gl.errorType.noError then error(gl.errorName(err)) end -gl.bufferData(gl.bufferTarget.arrayBuffer, vertices, gl.bufferUsage.staticDraw) +gl.bufferData(gl.bufferTarget.arrayBuffer, gl.dataType.float, vertices, gl.bufferUsage.staticDraw) if gl.getError() ~= gl.errorType.noError then error(gl.getError()) end gl.vertexAttribPointer(0, 3, false, 3, 0) diff --git a/src/gl/gl.c b/src/gl/gl.c index 953cefb..cef93fa 100644 --- a/src/gl/gl.c +++ b/src/gl/gl.c @@ -47,6 +47,11 @@ int gl_clear(lua_State *L); void setup_gl(lua_State *L, int honey_index) { + int data_types = hs_create_table(L, + hs_str_int("integer", GL_INT), + hs_str_int("float", GL_FLOAT), + ); + int error_types = hs_create_table(L, hs_str_int("noError", GL_NO_ERROR), hs_str_int("invalidEnum", GL_INVALID_ENUM), @@ -89,6 +94,7 @@ void setup_gl(lua_State *L, int honey_index) hs_str_cfunc("terminate", gl_terminate), hs_str_cfunc("getError", gl_get_error), + hs_str_tbl("dataType", data_types), hs_str_tbl("errorType", error_types), /* buffer */ |