comparison tests/test_materials.nim @ 868:252cbc10b25f

did: improve/refactor some of the material API
author Sam <sam@basx.dev>
date Wed, 03 Jan 2024 11:19:55 +0700
parents 19b5051d6eb7
children 91e018270832
comparison
equal deleted inserted replaced
867:8fd450acc6f8 868:252cbc10b25f
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