# HG changeset patch # User Sam # Date 1700927946 -25200 # Node ID f4f1474dc70a3b9743bb8f5fb14e19163f56001e # Parent eb2ac324a1626429afe678cd64957fd9c05ea04f fix: make tests working again diff -r eb2ac324a162 -r f4f1474dc70a tests/test_materials.nim --- a/tests/test_materials.nim Sat Nov 25 22:58:25 2023 +0700 +++ b/tests/test_materials.nim Sat Nov 25 22:59:06 2023 +0700 @@ -14,14 +14,26 @@ RT, RT, RT, RT, RT, RT, RT, ]) swiss = loadImage("flag.png") - material = Material(name: "material", textures: { - "tex1": Texture(image: thai, sampler: sampler), - "tex2": Texture(image: swiss, sampler: sampler), - }.toTable) + doubleTextureMaterial = MaterialType( + name:"Double texture", + meshAttributes: { + "position": Vec3F32, + "uv": Vec2F32, + }.toTable, + attributes: {"tex1": TextureType, "tex2": TextureType}.toTable + ) + material = MaterialData( + theType: doubleTextureMaterial, + name: "swiss-thai", + attributes: { + "tex1": initDataList(@[Texture(image: thai, sampler: sampler)]), + "tex2": initDataList(@[Texture(image: swiss, sampler: sampler)]), + }.toTable + ) proc main() = var flag = rect() - flag.materials = @[material] + flag.material = material var scene = Scene(name: "main", meshes: @[flag]) scene.addShaderGlobalArray("test2", @[0'f32, 0'f32]) @@ -51,9 +63,9 @@ """, ) engine.initRenderer({ - "material": shaderConfiguration1, + doubleTextureMaterial: shaderConfiguration1, }) - engine.addScene(scene) + engine.loadScene(scene) var t = cpuTime() while engine.updateInputs() == Running and not engine.keyIsDown(Escape): var d = float32(cpuTime() - t) diff -r eb2ac324a162 -r f4f1474dc70a tests/test_mesh.nim --- a/tests/test_mesh.nim Sat Nov 25 22:58:25 2023 +0700 +++ b/tests/test_mesh.nim Sat Nov 25 22:59:06 2023 +0700 @@ -1,11 +1,8 @@ -import std/algorithm -import std/sequtils -import std/tables import semicongine proc main() = var scenes = [ - Scene(name: "Donut", meshes: loadMeshes("tutorialk-donat.glb", COLORED_SINGLE_TEXTURE_MATERIAL)[0].toSeq), + Scene(name: "Donut", meshes: loadMeshes("donut.glb", COLORED_SINGLE_TEXTURE_MATERIAL)[0].toSeq), ] var engine = initEngine("Test meshes")