comparison examples/E03_hello_cube.nim @ 535:21c276c0a968

fix: stuff, add working pong
author Sam <sam@basx.dev>
date Mon, 06 Feb 2023 23:32:45 +0700
parents eb92723db7b2
children 0d8858aa0671
comparison
equal deleted inserted replaced
534:e1b60a09d7dc 535:21c276c0a968
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: [