Mercurial > games > semicongine
comparison examples/E01_hello_triangle.nim @ 763:a4c757f5d17f
did: change API for ECS
author | Sam <sam@basx.dev> |
---|---|
date | Tue, 27 Jun 2023 00:17:40 +0700 |
parents | 5cd6808150fc |
children | 754835bf175e |
comparison
equal
deleted
inserted
replaced
762:4f991bc3613a | 763:a4c757f5d17f |
---|---|
25 ) | 25 ) |
26 | 26 |
27 var | 27 var |
28 triangle = newScene("scene", newEntity( | 28 triangle = newScene("scene", newEntity( |
29 "triangle", | 29 "triangle", |
30 newMesh( | 30 {"mesh": Component(newMesh( |
31 [newVec3f(-0.5, 0.5), newVec3f(0, -0.5), newVec3f(0.5, 0.5)], | 31 [newVec3f(-0.5, 0.5), newVec3f(0, -0.5), newVec3f(0.5, 0.5)], |
32 [newVec4f(1, 0, 0, 1), newVec4f(0, 1, 0, 1), newVec4f(0, 0, 1, 1)], | 32 [newVec4f(1, 0, 0, 1), newVec4f(0, 1, 0, 1), newVec4f(0, 0, 1, 1)], |
33 ) | 33 ))} |
34 )) | 34 )) |
35 myengine = initEngine("Hello triangle") | 35 myengine = initEngine("Hello triangle") |
36 renderPass = myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode) | 36 renderPass = myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode) |
37 | 37 |
38 myengine.setRenderer(renderPass) | 38 myengine.setRenderer(renderPass) |