comparison examples/E02_squares.nim @ 606:f41c1b78cf5b

add: upgrade all simple examples to new engine version
author Sam <sam@basx.dev>
date Wed, 26 Apr 2023 02:15:43 +0700
parents 177bfb85adb1
children 23e41f5adbaf
comparison
equal deleted inserted replaced
605:510c651cb27d 606:f41c1b78cf5b
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()