comparison tests/test_vulkan_wrapper.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
comparison
equal deleted inserted replaced
271:95281f2db400 272:bfcb41211c5b
1 import std/tables
2
1 import semicongine 3 import semicongine
2 4
3 proc scene_different_mesh_types(): Entity = 5 proc scene_different_mesh_types(): Entity =
4 result = newEntity("root", 6 result = newEntity("root",
5 newEntity("triangle1", newMesh( 7 newEntity("triangle1", newMesh(
122 sampler.magnification = VK_FILTER_NEAREST 124 sampler.magnification = VK_FILTER_NEAREST
123 sampler.minification = VK_FILTER_NEAREST 125 sampler.minification = VK_FILTER_NEAREST
124 for scene in scenes.mitems: 126 for scene in scenes.mitems:
125 scene.addShaderGlobal("time", 0.0'f32) 127 scene.addShaderGlobal("time", 0.0'f32)
126 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) 128 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8])
127 scene.addTexture("my_little_texture", Texture(image: Image(width: 5, height: 5, imagedata: @[ 129 scene.addMaterial(Material(name: "my_material", textures: {"my_little_texture": Texture(image: Image(width: 5, height: 5, imagedata: @[
128 R, R, R, R, R, 130 R, R, R, R, R,
129 R, R, W, R, R, 131 R, R, W, R, R,
130 R, W, W, W, R, 132 R, W, W, W, R,
131 R, R, W, R, R, 133 R, R, W, R, R,
132 R, R, R, R, R, 134 R, R, R, R, R,
133 ]), sampler: sampler)) 135 ]), sampler: sampler)}.toTable))
134 engine.addScene(scene, vertexInput, samplers) 136 engine.addScene(scene, vertexInput, samplers, transformAttribute="")
135 137
136 # MAINLOOP 138 # MAINLOOP
137 echo "Setup successfull, start rendering" 139 echo "Setup successfull, start rendering"
138 for i in 0 ..< 3: 140 for i in 0 ..< 3:
139 for scene in scenes.mitems: 141 for scene in scenes.mitems: