diff tests/test_materials.nim @ 272:bfcb41211c5b

add: final font-rendering, API changes fixed
author Sam <sam@basx.dev>
date Tue, 30 May 2023 16:59:01 +0700
parents ad078e26a1c7
children da0bd61abe91
line wrap: on
line diff
--- a/tests/test_materials.nim	Tue May 30 16:58:35 2023 +0700
+++ b/tests/test_materials.nim	Tue May 30 16:59:01 2023 +0700
@@ -1,4 +1,5 @@
 import std/times
+import std/tables
 
 import semicongine
 
@@ -21,7 +22,8 @@
   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.addMaterial(Material(name:"my material", textures: {"my_texture": Texture(image: t1, sampler: sampler)}.toTable))
+  scene.addMaterial(Material(name:"my material", textures: {"my_texture": Texture(image: t2, sampler: sampler)}.toTable))
   scene.addShaderGlobalArray("test2", @[0'f32, 0'f32])
 
   var engine = initEngine("Test materials")
@@ -55,7 +57,7 @@
 """
     )
   engine.setRenderer(engine.gpuDevice.simpleForwardRenderPass(vertexCode, fragmentCode))
-  engine.addScene(scene, vertexInput, samplers)
+  engine.addScene(scene, vertexInput, samplers, transformAttribute="")
   var t = cpuTime()
   while engine.updateInputs() == Running and not engine.keyIsDown(Escape):
     var d = float32(cpuTime() - t)