diff 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
line wrap: on
line diff
--- a/examples/E03_hello_cube.nim	Sun Feb 05 21:57:59 2023 +0700
+++ b/examples/E03_hello_cube.nim	Mon Feb 06 23:32:59 2023 +0700
@@ -26,13 +26,11 @@
 var
   pipeline: RenderPipeline[VertexDataA, Uniforms]
   uniforms: Uniforms
-  t: float32
 
 
-proc globalUpdate(engine: var Engine, dt: float32) =
+proc globalUpdate(engine: var Engine, t, dt: float32) =
   let ratio = float32(engine.vulkan.frameSize.y) / float32(
       engine.vulkan.frameSize.x)
-  t += dt
   uniforms.model.value = translate3d(0'f32, 0'f32, 10'f32) * rotate3d(t,
       Yf32) #  * rotate3d(float32(PI), Yf32)