comparison examples/E03_hello_cube.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 myengine.setRenderer(myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode)) 80 myengine.setRenderer(myengine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode))
81 var cube = newScene("scene", newEntity("cube", newMesh(positions=cube_pos, indices=tris, colors=cube_color))) 81 var cube = newScene("scene", newEntity("cube", newMesh(positions=cube_pos, indices=tris, colors=cube_color)))
82 cube.addShaderGlobal("projection", Unit4f32) 82 cube.addShaderGlobal("projection", Unit4f32)
83 cube.addShaderGlobal("view", Unit4f32) 83 cube.addShaderGlobal("view", Unit4f32)
84 cube.addShaderGlobal("model", Unit4f32) 84 cube.addShaderGlobal("model", Unit4f32)
85 myengine.addScene(cube, vertexInput, @[]) 85 myengine.addScene(cube, vertexInput, @[], transformAttribute="")
86 86
87 var t: float32 = cpuTime() 87 var t: float32 = cpuTime()
88 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape): 88 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape):
89 setShaderGlobal(cube, "model", translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, Yf32)) 89 setShaderGlobal(cube, "model", translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, Yf32))
90 setShaderGlobal(cube, "projection", 90 setShaderGlobal(cube, "projection",