diff options
Diffstat (limited to 'honey/asset/mesh.lua')
-rw-r--r-- | honey/asset/mesh.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/honey/asset/mesh.lua b/honey/asset/mesh.lua index 876c5e4..5e0a26d 100644 --- a/honey/asset/mesh.lua +++ b/honey/asset/mesh.lua @@ -136,14 +136,20 @@ end --===== builtin meshes =====-- -function createBuiltins() - cache["builtin.quad"] = {Mesh( +local function builtin(name, vertices, indices) + local vao, vbo, ebo, count = createMesh(vertices, indices) + cache[name] = { {vao=vao, vbo=vbo, ebo=ebo, count=count } } +end + +init = function() + builtin( + "builtin.quad", { 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1 }, { 0, 1, 3, 0, 3, 2 } - )} + ) end |