comparison tests/test_materials.nim @ 407:ffc265916415

did: improve/refactor some of the material API
author Sam <sam@basx.dev>
date Wed, 03 Jan 2024 11:19:55 +0700
parents eaf084ba80e5
children 91e018270832
comparison
equal deleted inserted replaced
406:7d926cc81620 407:ffc265916415
20 "position": Vec3F32, 20 "position": Vec3F32,
21 "uv": Vec2F32, 21 "uv": Vec2F32,
22 }.toTable, 22 }.toTable,
23 attributes: {"tex1": TextureType, "tex2": TextureType}.toTable 23 attributes: {"tex1": TextureType, "tex2": TextureType}.toTable
24 ) 24 )
25 material = MaterialData( 25 material = initMaterialData(
26 theType: doubleTextureMaterial, 26 theType=doubleTextureMaterial,
27 name: "swiss-thai", 27 name="swiss-thai",
28 attributes: { 28 attributes={
29 "tex1": initDataList(@[Texture(image: thai, sampler: sampler)]), 29 "tex1": initDataList(@[Texture(image: thai, sampler: sampler)]),
30 "tex2": initDataList(@[Texture(image: swiss, sampler: sampler)]), 30 "tex2": initDataList(@[Texture(image: swiss, sampler: sampler)]),
31 }.toTable 31 }
32 ) 32 )
33 33
34 proc main() = 34 proc main() =
35 var flag = rect() 35 var flag = rect()
36 flag.material = material 36 flag.material = material