comparison examples/E03_hello_cube.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 8bb27869b649
children 25d97fa0ad5c
comparison
equal deleted inserted replaced
144:01881f9296fa 145:a4e6e76128e6
85 cube.components.add view 85 cube.components.add view
86 cube.components.add model 86 cube.components.add model
87 myengine.addScene(cube, vertexInput) 87 myengine.addScene(cube, vertexInput)
88 88
89 var t: float32 = cpuTime() 89 var t: float32 = cpuTime()
90 while myengine.running and not myengine.keyWasPressed(Escape): 90 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape):
91 myengine.updateInputs()
92 setValue[Mat4](model.value, translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, Yf32)) 91 setValue[Mat4](model.value, translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, Yf32))
93 setValue[Mat4]( 92 setValue[Mat4](
94 projection.value, 93 projection.value,
95 perspective( 94 perspective(
96 float32(PI / 4), 95 float32(PI / 4),