# HG changeset patch
# User Sam <sam@basx.dev>
# Date 1684691501 -25200
# Node ID 37ef17c96bdb362db5d8c6df920ba70f1f37ac8b
# Parent  782b4df0d99d9dd65398a2a85e15f866fd61fecc
did: adjust to new API

diff -r 782b4df0d99d -r 37ef17c96bdb tests/test_materials.nim
--- a/tests/test_materials.nim	Mon May 22 00:50:41 2023 +0700
+++ b/tests/test_materials.nim	Mon May 22 00:51:41 2023 +0700
@@ -6,6 +6,7 @@
   var scene = newScene("main", root=newEntity("rect", rect()))
   let (RT, WT, PT) = (hexToColorAlpha("A51931").asPixel, hexToColorAlpha("F4F5F8").asPixel, hexToColorAlpha("2D2A4A").asPixel)
   let
+    # image from memory
     t1 = Image(width: 7, height: 5, imagedata: @[
       RT, RT, RT, RT, RT, RT, RT,
       WT, WT, WT, WT, WT, WT, WT,
@@ -13,8 +14,12 @@
       WT, WT, WT, WT, WT, WT, WT,
       RT, RT, RT, RT, RT, RT, RT,
     ])
+    # image from file
     t2 = loadImage("flag.png")
-  scene.addTextures("my_texture", @[t1, t2], interpolation=VK_FILTER_NEAREST)
+  var sampler = DefaultSampler()
+  sampler.magnification = VK_FILTER_NEAREST
+  sampler.minification = VK_FILTER_NEAREST
+  scene.addTextures("my_texture", @[Texture(image: t1, sampler: sampler), Texture(image: t2, sampler: sampler)])
   scene.addShaderGlobalArray("test2", @[0'f32, 0'f32])
 
   var engine = initEngine("Test materials")
diff -r 782b4df0d99d -r 37ef17c96bdb tests/test_mesh.nim
--- a/tests/test_mesh.nim	Mon May 22 00:50:41 2023 +0700
+++ b/tests/test_mesh.nim	Mon May 22 00:51:41 2023 +0700
@@ -18,13 +18,13 @@
     ]
     vertexOutput = @[attr[Vec4f]("vertexColor")]
     fragOutput = @[attr[Vec4f]("color")]
-    uniforms = @[attr[Mat4]("transform"), attr[Vec4f]("material_colors", arrayCount=16), ]
+    uniforms = @[attr[Mat4]("transform"), attr[Vec4f]("material_color", arrayCount=16), ]
     vertexCode = compileGlslShader(
       stage=VK_SHADER_STAGE_VERTEX_BIT,
       inputs=vertexInput,
       outputs=vertexOutput,
       uniforms=uniforms,
-      main="""gl_Position = vec4(position, 1.0) * Uniforms.transform; vertexColor = Uniforms.material_colors[material];"""
+      main="""gl_Position = vec4(position, 1.0) * Uniforms.transform; vertexColor = Uniforms.material_color[material];"""
     )
     fragmentCode = compileGlslShader(
       stage=VK_SHADER_STAGE_FRAGMENT_BIT,