comparison examples/E01_hello_triangle.nim @ 302:da0bd61abe91

did: change API for ECS
author Sam <sam@basx.dev>
date Tue, 27 Jun 2023 00:17:40 +0700
parents b17df28712d6
children b145a05c2459
comparison
equal deleted inserted replaced
301:bf5982802e2c 302:da0bd61abe91
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)