changeset 163:25d97fa0ad5c

fix: API change for shader attributes
author Sam <sam@basx.dev>
date Sat, 29 Apr 2023 18:29:19 +0700
parents 68947a8ee127
children 7a0ca5c01095
files examples/E01_hello_triangle.nim examples/E02_squares.nim examples/E03_hello_cube.nim examples/E04_input.nim examples/E10_pong.nim
diffstat 5 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/examples/E01_hello_triangle.nim	Sat Apr 29 17:41:40 2023 +0700
+++ b/examples/E01_hello_triangle.nim	Sat Apr 29 18:29:19 2023 +0700
@@ -3,8 +3,8 @@
 
 const
   vertexInput = @[
-    attr[Vec3f]("position", memoryLocation=VRAM),
-    attr[Vec3f]("color", memoryLocation=VRAM),
+    attr[Vec3f]("position"),
+    attr[Vec3f]("color"),
   ]
   vertexOutput = @[attr[Vec3f]("outcolor")]
   fragOutput = @[attr[Vec4f]("color")]
--- a/examples/E02_squares.nim	Sat Apr 29 17:41:40 2023 +0700
+++ b/examples/E02_squares.nim	Sat Apr 29 18:29:19 2023 +0700
@@ -46,9 +46,9 @@
 
   const
     vertexInput = @[
-      attr[Vec3f]("position", memoryLocation=VRAM),
-      attr[Vec3f]("color", memoryLocation=VRAMVisible),
-      attr[uint32]("index", memoryLocation=VRAM),
+      attr[Vec3f]("position"),
+      attr[Vec3f]("color", memoryPerformanceHint=PreferFastWrite),
+      attr[uint32]("index"),
     ]
     vertexOutput = @[attr[Vec3f]("outcolor")]
     uniforms = @[attr[float32]("time")]
--- a/examples/E03_hello_cube.nim	Sat Apr 29 17:41:40 2023 +0700
+++ b/examples/E03_hello_cube.nim	Sat Apr 29 18:29:19 2023 +0700
@@ -51,8 +51,8 @@
 
   const
     vertexInput = @[
-      attr[Vec3f]("position", memoryLocation=VRAM),
-      attr[Vec3f]("color", memoryLocation=VRAMVisible),
+      attr[Vec3f]("position"),
+      attr[Vec3f]("color", memoryPerformanceHint=PreferFastWrite),
     ]
     vertexOutput = @[attr[Vec3f]("outcolor")]
     uniforms = @[
--- a/examples/E04_input.nim	Sat Apr 29 17:41:40 2023 +0700
+++ b/examples/E04_input.nim	Sat Apr 29 18:29:19 2023 +0700
@@ -150,9 +150,9 @@
   # shaders
   const
     vertexInput = @[
-      attr[Vec3f]("position", memoryLocation=VRAM),
-      attr[Vec3f]("color", memoryLocation=VRAMVisible),
-      attr[Mat4]("transform", memoryLocation=VRAMVisible, perInstance=true),
+      attr[Vec3f]("position"),
+      attr[Vec3f]("color", memoryPerformanceHint=PreferFastWrite),
+      attr[Mat4]("transform", memoryPerformanceHint=PreferFastWrite, perInstance=true),
     ]
     vertexOutput = @[attr[Vec3f]("outcolor")]
     uniforms = @[attr[Mat4]("projection")]
--- a/examples/E10_pong.nim	Sat Apr 29 17:41:40 2023 +0700
+++ b/examples/E10_pong.nim	Sat Apr 29 18:29:19 2023 +0700
@@ -21,7 +21,7 @@
   level = newEntity("Level")
   var playerbarmesh = rect(color=barcolor)
   var playerbar = newEntity("playerbar", playerbarmesh)
-  playerbar.transform = scale3d(barWidth, barSize, 1'f) * translate3d(0.5'f, 0'f, 0'f)
+  # playerbar.transform = scale3d(barWidth, barSize, 1'f) * translate3d(0.5'f, 0'f, 0'f)
   var player = newEntity("player", playerbar)
   player.transform = translate3d(0'f, 0.3'f, 0'f)
   level.add player