Mercurial > games > semicongine
comparison test2.nim @ 1160:836dc1eda5e3 compiletime-tests
did: some stuff
author | sam <sam@basx.dev> |
---|---|
date | Wed, 19 Jun 2024 09:17:24 +0700 |
parents | e7cbb13999e4 |
children | dbca0528c714 |
comparison
equal
deleted
inserted
replaced
1159:e7cbb13999e4 | 1160:836dc1eda5e3 |
---|---|
1 import std/os | |
2 | |
3 import semicongine/platform/window | |
4 import semicongine/core/vulkanapi | |
5 import semicongine/vulkan/instance | |
6 import semicongine/vulkan/device | |
7 import semicongine/vulkan/physicaldevice | |
8 # import ./vulkan/shader | |
9 | |
10 import semicongine/core/vector | |
11 import semicongine/core/matrix | |
12 | |
1 type | 13 type |
2 ShaderInputA = object | 14 MeshA = object |
3 positions {.VertexAttribute.}: seq[Vec3f] | 15 positions: seq[Vec3f] |
4 colors {.VertexAttribute.}: seq[Vec3f] | 16 colors: seq[Vec3f] |
5 transforms {.InstanceAttribute.}: seq[Vec3f] | 17 transparency: float32 |
6 other: bool | 18 ArrayData = object |
19 transforms: seq[Vec3f] | |
20 | |
7 Enemy = object | 21 Enemy = object |
8 shaderData: ShaderInputA | 22 mesh: MeshA |
23 enemies: ArrayData | |
9 | 24 |
10 proc initEnemy() | 25 let e = Enemy() |
26 echo e | |
27 | |
28 let w = CreateWindow("test2") | |
29 putEnv("VK_LAYER_ENABLES", "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_AMD,VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA,VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXTVK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT") | |
30 let i = w.CreateInstance( | |
31 vulkanVersion = VK_MAKE_API_VERSION(0, 1, 3, 0), | |
32 instanceExtensions = @[], | |
33 layers = @["VK_LAYER_KHRONOS_validation"], | |
34 ) | |
35 | |
36 let selectedPhysicalDevice = i.GetPhysicalDevices().FilterBestGraphics() | |
37 let d = i.CreateDevice( | |
38 selectedPhysicalDevice, | |
39 enabledExtensions = @[], | |
40 selectedPhysicalDevice.FilterForGraphicsPresentationQueues() | |
41 ) |