Vulkan之Surface

vulkan并没有直接的显示窗口的,这块是由第三方的组件来实现的,我们可以直接调用glfw的接口直接创建surface

1
2
3
4
5
6
7
VkSurfaceKHR surface;

void createSurface() {
if (glfwCreateWindowSurface(instance, window, nullptr, &surface) != VK_SUCCESS) {
throw std::runtime_error("failed to create window surface!");
}
}

显示 Gitment 评论