From 445fc5217859a799e3a977c9763141d9a5f6cbb5 Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 19 Apr 2023 23:49:38 -0500 Subject: add split drawing function and renderQuad component --- main.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 0f46f70..ff746c7 100644 --- a/main.lua +++ b/main.lua @@ -65,6 +65,7 @@ function setupEntities() entities:addComponents(camera, { camera={ projection=Mat4():perspective(math.rad(45), 640/480, 0.1, 100), + render="screen", }, transform={ matrix=Mat4():identity():translate(Vec3{0, 0, -6}), @@ -126,13 +127,22 @@ function setupEntities() entities:addComponents(id2, { renderMesh = { shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, - mesh = { filename="assets/tetrahedron.obj", index=1 }, + --mesh = { filename="assets/tetrahedron.obj", index=1 }, + mesh = { filename="builtin.quad", index=1 }, }, transform = { parent=id, matrix=Mat4():identity():translate(Vec3{0, 2, 0}), }, }) + + local quad = entities:createEntity() + entities:addComponents(quad, { + renderQuad = { + shader = { vertex="vertex.glsl", fragment="fragment.glsl" }, + textures = { ourTexture = { filename = "44d9a0ec1c18e6126a5e9d9d9317f5ac.png" } }, + }, + }) end setupEntities() -- cgit v1.2.1