Mercurial > games > semicongine
comparison tests/test_vulkan_wrapper.nim @ 249:0ec43b857a7e
fix: api change of texture
author | Sam <sam@basx.dev> |
---|---|
date | Tue, 23 May 2023 16:29:01 +0700 |
parents | 3cbbf50e9e4c |
children | ad078e26a1c7 |
comparison
equal
deleted
inserted
replaced
248:952428f04ffc | 249:0ec43b857a7e |
---|---|
116 newScene("simple", scene_simple()), | 116 newScene("simple", scene_simple()), |
117 newScene("different mesh types", scene_different_mesh_types()), | 117 newScene("different mesh types", scene_different_mesh_types()), |
118 newScene("primitives", scene_primitives()), | 118 newScene("primitives", scene_primitives()), |
119 newScene("flag", scene_flag()), | 119 newScene("flag", scene_flag()), |
120 ] | 120 ] |
121 var sampler = DefaultSampler() | |
122 sampler.magnification = VK_FILTER_NEAREST | |
123 sampler.minification = VK_FILTER_NEAREST | |
121 for scene in scenes.mitems: | 124 for scene in scenes.mitems: |
122 scene.addShaderGlobal("time", 0.0'f32) | 125 scene.addShaderGlobal("time", 0.0'f32) |
123 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) | 126 let (R, W) = ([255'u8, 0'u8, 0'u8, 255'u8], [255'u8, 255'u8, 255'u8, 255'u8]) |
124 scene.addTexture("my_little_texture", Image(width: 5, height: 5, imagedata: @[ | 127 scene.addTexture("my_little_texture", Texture(image: Image(width: 5, height: 5, imagedata: @[ |
125 R, R, R, R, R, | 128 R, R, R, R, R, |
126 R, R, W, R, R, | 129 R, R, W, R, R, |
127 R, W, W, W, R, | 130 R, W, W, W, R, |
128 R, R, W, R, R, | 131 R, R, W, R, R, |
129 R, R, R, R, R, | 132 R, R, R, R, R, |
130 ]), VK_FILTER_NEAREST) | 133 ]), sampler: sampler)) |
131 engine.addScene(scene, vertexInput) | 134 engine.addScene(scene, vertexInput) |
132 | 135 |
133 # MAINLOOP | 136 # MAINLOOP |
134 echo "Setup successfull, start rendering" | 137 echo "Setup successfull, start rendering" |
135 for i in 0 ..< 3: | 138 for i in 0 ..< 3: |