Mercurial > games > semicongine
comparison src/vulkan.nim @ 5:4ed9cb098315
add: structure code for crossplatform, add some input handling + bugfixes
author | Sam <sam@basx.dev> |
---|---|
date | Thu, 22 Dec 2022 00:06:40 +0700 |
parents | af9183acb173 |
children | 0660ba9d1930 |
comparison
equal
deleted
inserted
replaced
4:af9183acb173 | 5:4ed9cb098315 |
---|---|
2 | 2 |
3 ## Vulkan Bindings | 3 ## Vulkan Bindings |
4 ## ==== | 4 ## ==== |
5 ## WARNING: This is a generated file. Do not edit | 5 ## WARNING: This is a generated file. Do not edit |
6 ## Any edits will be overwritten by the generator. | 6 ## Any edits will be overwritten by the generator. |
7 import x11/xlib | 7 |
8 import x11/x | 8 when defined(linux): |
9 import x11/x | |
10 import x11/xlib | |
11 when defined(windows): | |
12 import winim | |
9 | 13 |
10 var vkGetProc: proc(procName: cstring): pointer {.cdecl.} | 14 var vkGetProc: proc(procName: cstring): pointer {.cdecl.} |
11 | 15 |
12 import dynlib | 16 import dynlib |
13 | 17 |
14 when defined(windows): | 18 when defined(windows): |
15 {. emit: """#define VK_USE_PLATFORM_WIN32_KHR""" .} | 19 {. emit: """#define VK_USE_PLATFORM_WIN32_KHR""" .} |
20 # {.passl: gorge("pkg-config --libs vulkan").} | |
16 const vkDLL = "vulkan-1.dll" | 21 const vkDLL = "vulkan-1.dll" |
17 elif defined(linux): | 22 elif defined(linux): |
18 {.passl: gorge("pkg-config --libs vulkan").} | 23 {.passl: gorge("pkg-config --libs vulkan").} |
19 {. emit: """#define VK_USE_PLATFORM_X11_KHR""" .} | 24 {. emit: """#define VK_USE_PLATFORM_X11_KHR""" .} |
20 const vkDLL = "libvulkan.so.1" | 25 const vkDLL = "libvulkan.so.1" |
509 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47 | 514 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47 |
510 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48 | 515 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48 |
511 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000 # added by sam | 516 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000 # added by sam |
512 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001 # added by sam | 517 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001 # added by sam |
513 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000 # added by sam | 518 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000 # added by sam |
519 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000 # added by sam | |
514 VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004 # added by sam | 520 VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004 # added by sam |
515 VkSubpassContents* {.size: int32.sizeof.} = enum | 521 VkSubpassContents* {.size: int32.sizeof.} = enum |
516 VK_SUBPASS_CONTENTS_INLINE = 0 | 522 VK_SUBPASS_CONTENTS_INLINE = 0 |
517 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1 | 523 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1 |
518 VkResult* {.size: int32.sizeof.} = enum | 524 VkResult* {.size: int32.sizeof.} = enum |
1189 VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = 8 | 1195 VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = 8 |
1190 VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = 16 | 1196 VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = 16 |
1191 | 1197 |
1192 # Types | 1198 # Types |
1193 | 1199 |
1200 # stub types if we are on the wrong platform, so we don't need to "when" all platform functions | |
1201 when not defined(linux): | |
1202 type | |
1203 Display* = ptr object | |
1204 VisualID* = ptr object | |
1205 Window* = ptr object | |
1206 when not defined(windows): | |
1207 type | |
1208 HINSTANCE* = ptr object | |
1209 HWND* = ptr object | |
1210 HMONITOR* = ptr object | |
1211 HANDLE* = ptr object | |
1212 SECURITY_ATTRIBUTES* = ptr object | |
1213 DWORD* = ptr object | |
1214 LPCWSTR* = ptr object | |
1215 | |
1194 type | 1216 type |
1195 # Display* = ptr object | |
1196 VisualID* = ptr object | |
1197 # Window* = ptr object | |
1198 RROutput* = ptr object | 1217 RROutput* = ptr object |
1199 wl_display* = ptr object | 1218 wl_display* = ptr object |
1200 wl_surface* = ptr object | 1219 wl_surface* = ptr object |
1201 HINSTANCE* = ptr object | |
1202 HWND* = ptr object | |
1203 HMONITOR* = ptr object | |
1204 HANDLE* = ptr object | |
1205 SECURITY_ATTRIBUTES* = ptr object | |
1206 DWORD* = ptr object | |
1207 LPCWSTR* = ptr object | |
1208 xcb_connection_t* = ptr object | 1220 xcb_connection_t* = ptr object |
1209 xcb_visualid_t* = ptr object | 1221 xcb_visualid_t* = ptr object |
1210 xcb_window_t* = ptr object | 1222 xcb_window_t* = ptr object |
1211 IDirectFB* = ptr object | 1223 IDirectFB* = ptr object |
1212 IDirectFBSurface* = ptr object | 1224 IDirectFBSurface* = ptr object |