comparison tests/test_vulkan_wrapper.nim @ 117:40ff2453855e

did: small changes from refactoring
author Sam <sam@basx.dev>
date Wed, 05 Apr 2023 00:41:11 +0700
parents e18538442837
children 2780d9aad142
comparison
equal deleted inserted replaced
116:bbe221af55d1 117:40ff2453855e
1 import std/os
1 import std/options 2 import std/options
2 3
3 import semicongine/vulkan 4 import semicongine
4 import semicongine/platform/window
5 import semicongine/math
6 import semicongine/entity
7 import semicongine/scene
8 import semicongine/gpu_data
9 import semicongine/mesh
10 5
11 proc diagnostics(instance: Instance) = 6 proc diagnostics(instance: Instance) =
12 # diagnostic output 7 # diagnostic output
13 # print basic driver infos 8 # print basic driver infos
14 echo "Layers" 9 echo "Layers"
38 echo " Surface formats" 33 echo " Surface formats"
39 for format in device.getSurfaceFormats(): 34 for format in device.getSurfaceFormats():
40 echo " " & $format 35 echo " " & $format
41 36
42 when isMainModule: 37 when isMainModule:
43
44 # INIT ENGINE: 38 # INIT ENGINE:
45 # create instance 39 # create instance
46 var thewindow = createWindow("Test") 40 var thewindow = createWindow("Test")
47 var instance = thewindow.createInstance( 41 var instance = thewindow.createInstance(
48 vulkanVersion=VK_MAKE_API_VERSION(0, 1, 3, 0), 42 vulkanVersion=VK_MAKE_API_VERSION(0, 1, 3, 0),
90 84
91 # INIT SCENE 85 # INIT SCENE
92 var thescene = Scene( 86 var thescene = Scene(
93 name: "main", 87 name: "main",
94 root: newEntity("root", 88 root: newEntity("root",
95 newEntity("triangle1", initMesh( 89 newEntity("triangle1", newMesh(
96 positions=[newVec3f(0.0, -0.5), newVec3f(0.5, 0.5), newVec3f(-0.5, 0.5)], 90 positions=[newVec3f(0.0, -0.5), newVec3f(0.5, 0.5), newVec3f(-0.5, 0.5)],
97 colors=[newVec3f(1.0, 0.0, 0.0), newVec3f(0.0, 1.0, 0.0), newVec3f(0.0, 0.0, 1.0)], 91 colors=[newVec3f(1.0, 0.0, 0.0), newVec3f(0.0, 1.0, 0.0), newVec3f(0.0, 0.0, 1.0)],
98 )), 92 )),
99 ) 93 )
100 ) 94 )