comparison examples/E02_squares.nim @ 714:5f7ec8d1bd33

fix: API changes
author sam <sam@basx.dev>
date Wed, 24 May 2023 01:31:21 +0700
parents d84b2e88776a
children dcc12ab20a91
comparison
equal deleted inserted replaced
713:cdb3ff9b0047 714:5f7ec8d1bd33
80 80
81 var myengine = initEngine("Squares") 81 var myengine = initEngine("Squares")
82 myengine.setRenderer(myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode)) 82 myengine.setRenderer(myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode))
83 83
84 var scene = newScene("scene", newEntity("scene", newEntity("squares", squaremesh))) 84 var scene = newScene("scene", newEntity("scene", newEntity("squares", squaremesh)))
85 myengine.addScene(scene, vertexInput) 85 myengine.addScene(scene, vertexInput, @[])
86 scene.addShaderGlobal("time", 0.0'f32) 86 scene.addShaderGlobal("time", 0.0'f32)
87 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape): 87 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape):
88 setShaderGlobal(scene, "time", getShaderGlobal[float32](scene, "time") + 0.0005'f) 88 setShaderGlobal(scene, "time", getShaderGlobal[float32](scene, "time") + 0.0005'f)
89 myengine.renderScene(scene) 89 myengine.renderScene(scene)
90 90