diff tests/test_materials.nim @ 244:f52fccedf5ab

did: adjust to new API
author Sam <sam@basx.dev>
date Mon, 22 May 2023 00:51:41 +0700
parents 3918e42bf26e
children ad078e26a1c7
line wrap: on
line diff
--- 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")