summaryrefslogtreecommitdiff
path: root/honey/asset/mesh.lua
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-05-12 14:10:48 -0500
committersanine-a <sanine.not@pm.me>2023-05-12 14:10:48 -0500
commit0d96ebc90c9740e7e66a70aa11168b11f49d220b (patch)
tree758403f74f4fbcab61a228ef58e720850b3f70db /honey/asset/mesh.lua
parent6036d1b5d7e0fc160637ce70595bac57ed1fcd00 (diff)
run working program with refactored code
Diffstat (limited to 'honey/asset/mesh.lua')
-rw-r--r--honey/asset/mesh.lua12
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