summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-04-19 23:49:38 -0500
committersanine <sanine.not@pm.me>2023-04-19 23:49:38 -0500
commit445fc5217859a799e3a977c9763141d9a5f6cbb5 (patch)
tree9fe30aa97fe5d44b1f6fe0f85fe62543f5c2db4b /main.lua
parent02c6f822e2cca41d5d28afd9f3a05211316587fd (diff)
add split drawing function and renderQuad component
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua12
1 files changed, 11 insertions, 1 deletions
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()