Mercurial > games > semicongine
comparison examples/E02_squares.nim @ 145:a4e6e76128e6
add: upgrade all simple examples to new engine version
author | Sam <sam@basx.dev> |
---|---|
date | Wed, 26 Apr 2023 02:15:43 +0700 |
parents | 34112bf5abf8 |
children | ae8b0d89a2ee |
comparison
equal
deleted
inserted
replaced
144:01881f9296fa | 145:a4e6e76128e6 |
---|---|
91 | 91 |
92 var scene = newEntity("scene", newEntity("squares", squaremesh)) | 92 var scene = newEntity("scene", newEntity("squares", squaremesh)) |
93 myengine.addScene(scene, vertexInput) | 93 myengine.addScene(scene, vertexInput) |
94 var time = initShaderGlobal("time", 0.0'f32) | 94 var time = initShaderGlobal("time", 0.0'f32) |
95 scene.components.add time | 95 scene.components.add time |
96 while myengine.running and not myengine.keyWasPressed(Escape): | 96 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape): |
97 myengine.updateInputs() | |
98 setValue[float32](time.value, get[float32](time.value) + 0.0005) | 97 setValue[float32](time.value, get[float32](time.value) + 0.0005) |
99 myengine.renderScene(scene) | 98 myengine.renderScene(scene) |
100 | 99 |
101 myengine.destroy() | 100 myengine.destroy() |