Mercurial > games > semicongine
comparison examples/E02_squares.nim @ 278:b17df28712d6
did: adjust for small API change
author | Sam <sam@basx.dev> |
---|---|
date | Sat, 03 Jun 2023 13:44:17 +0700 |
parents | 95281f2db400 |
children | da0bd61abe91 |
comparison
equal
deleted
inserted
replaced
277:1fbef3a2d769 | 278:b17df28712d6 |
---|---|
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, @[], transformAttribute="") |
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 |