From 0d96ebc90c9740e7e66a70aa11168b11f49d220b Mon Sep 17 00:00:00 2001 From: sanine-a Date: Fri, 12 May 2023 14:10:48 -0500 Subject: run working program with refactored code --- honey/asset/mesh.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'honey/asset/mesh.lua') 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 -- cgit v1.2.1