summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/wsi/win32/wsi_presenter_win32.cpp
blob: b3ff9b5a34c3c0d79609a4d89b9e0d600ee00d27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../wsi_presenter.h"

namespace dxvk::wsi {

  VkResult createSurface(
          HWND                hWindow,
    const Rc<vk::InstanceFn>& vki,
          VkSurfaceKHR*       pSurface) {
    HINSTANCE hInstance = reinterpret_cast<HINSTANCE>(
      GetWindowLongPtr(hWindow, GWLP_HINSTANCE));

    VkWin32SurfaceCreateInfoKHR info;
    info.sType      = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
    info.pNext      = nullptr;
    info.flags      = 0;
    info.hinstance  = hInstance;
    info.hwnd       = hWindow;
    
    return vki->vkCreateWin32SurfaceKHR(
      vki->instance(), &info, nullptr, pSurface);
  }

}