Mercurial > games > semicongine
comparison examples/E03_hello_cube.nim @ 74:779607656b12
fix: stuff, add working pong
| author | Sam <sam@basx.dev> |
|---|---|
| date | Mon, 06 Feb 2023 23:32:59 +0700 |
| parents | bdef52f3bc0d |
| children | 8bb27869b649 |
comparison
equal
deleted
inserted
replaced
| 73:17c12b79faaa | 74:779607656b12 |
|---|---|
| 24 projection: Descriptor[Mat44] | 24 projection: Descriptor[Mat44] |
| 25 | 25 |
| 26 var | 26 var |
| 27 pipeline: RenderPipeline[VertexDataA, Uniforms] | 27 pipeline: RenderPipeline[VertexDataA, Uniforms] |
| 28 uniforms: Uniforms | 28 uniforms: Uniforms |
| 29 t: float32 | |
| 30 | 29 |
| 31 | 30 |
| 32 proc globalUpdate(engine: var Engine, dt: float32) = | 31 proc globalUpdate(engine: var Engine, t, dt: float32) = |
| 33 let ratio = float32(engine.vulkan.frameSize.y) / float32( | 32 let ratio = float32(engine.vulkan.frameSize.y) / float32( |
| 34 engine.vulkan.frameSize.x) | 33 engine.vulkan.frameSize.x) |
| 35 t += dt | |
| 36 uniforms.model.value = translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, | 34 uniforms.model.value = translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t, |
| 37 Yf32) # * rotate3d(float32(PI), Yf32) | 35 Yf32) # * rotate3d(float32(PI), Yf32) |
| 38 | 36 |
| 39 uniforms.view.value = Unit44f32 | 37 uniforms.view.value = Unit44f32 |
| 40 uniforms.projection.value = Mat44(data: [ | 38 uniforms.projection.value = Mat44(data: [ |
