Examples: SDL,GLFW,Vulkan: The Platform<>Renderer link is handled by SDL/GLFW platforms, both can compile without Vulkan headers, SDL+Vulkan is now on part with GLFW+Vulkan (aka broken the same way!). (#1542)

This commit is contained in:
omar
2018-03-13 23:16:15 +01:00
parent 98b66a5fc9
commit d0e0b106f0
5 changed files with 67 additions and 27 deletions

View File

@ -311,17 +311,6 @@ static void glfw_resize_callback(GLFWwindow*, int w, int h)
g_ResizeHeight = h;
}
static int glfw_create_vk_surface(void* platform_handle, ImU64 vk_instance, const void* vk_allocator, ImU64* out_vk_surface)
{
GLFWwindow* window = (GLFWwindow*)platform_handle;
VkInstance instance = (VkInstance)vk_instance;
const VkAllocationCallbacks* allocator = (const VkAllocationCallbacks*)vk_allocator;
VkSurfaceKHR* surface = (VkSurfaceKHR*)out_vk_surface;
VkResult err = glfwCreateWindowSurface(instance, window, allocator, surface);
check_vk_result(err);
return (int)err;
}
int main(int, char**)
{
// Setup window
@ -363,7 +352,6 @@ int main(int, char**)
// Setup GLFW binding
ImGui_ImplGlfw_InitForVulkan(window, true);
io.PlatformInterface.CreateVkSurface = glfw_create_vk_surface;
// Setup Vulkan binding
ImGui_ImplVulkan_InitInfo init_info = {};