view semiconginev2/platform/windows/surface.nim @ 1229:5dcb503ef0c0

did: refactor renderpass a bit, enable depth buffering and msaa on offscreen-rendering
author sam <sam@basx.dev>
date Thu, 18 Jul 2024 21:32:41 +0700
parents 56781cc0fc7c
children
line wrap: on
line source

proc CreateNativeSurface*(instance: VkInstance, window: NativeWindow): VkSurfaceKHR =
  assert instance.Valid
  var surfaceCreateInfo = VkWin32SurfaceCreateInfoKHR(
    sType: VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
    hinstance: cast[HINSTANCE](window.hinstance),
    hwnd: cast[HWND](window.hwnd),
  )
  checkVkResult vkCreateWin32SurfaceKHR(instance, addr(surfaceCreateInfo), nil, addr(result))