Mercurial > games > semicongine
comparison examples/E03_hello_cube.nim @ 739:5cd6808150fc
did: adjust for small API change
author | Sam <sam@basx.dev> |
---|---|
date | Sat, 03 Jun 2023 13:44:17 +0700 |
parents | dcc12ab20a91 |
children | a4c757f5d17f |
comparison
equal
deleted
inserted
replaced
738:eb1a6ca20a84 | 739:5cd6808150fc |
---|---|
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", |