BulBul
BulBul

Reputation: 1209

Cannot use vkCreateWin32SurfaceKHR to create vulkan surface

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.

Upvotes: 6

Views: 5331

Answers (1)

ratchet freak
ratchet freak

Reputation: 48196

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.

Upvotes: 11

Related Questions