5

I want to use vulkan with SDL2 but I am stuck at the surface creation stage, i cannot use vkCreateWin32SurfaceKHR extension function as well as VkWin32SurfaceCreateInfoKHR extension struct as they are undefined, while i don't have any issues using other extension elements like (vkGetPhysicalDeviceSurfaceSupportKHR , etc ..), does the surface extension needs a separate header file? how can i get it to work?

the preprocessor directives i use are as follows

#include <vulkan\vulkan.h>
#include <SDL.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <exception>
#define VK_USE_PLATFORM_WIN32_KHR

Please note that i have used Vulkan with glfw without having any program this is my second attempt of running vulkan, so i don't think i have any driver support issue.

BulBul
  • 1,159
  • 3
  • 24
  • 37

1 Answers1

9

Put the #define VK_USE_PLATFORM_WIN32_KHR before you #include <vulkan\vulkan.h>

then you can grab the native info you need from SDL_GetWindowWMInfo.

ratchet freak
  • 47,288
  • 5
  • 68
  • 106
  • thank you for your kind support now it works just fine, i use multiple header and .cpp files, so i somehow end up using it at the end of all inclusions. – BulBul Mar 22 '17 at 18:36