comparison examples/E03_hello_cube.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 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, @[])
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",