mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 21:56:36 +00:00
Update vulkan.c
I know it is overkill but in first OpenGL releases, there is have only two or three Extensions. I think it is same for Vulkan. More futuristic...
This commit is contained in:
parent
e6a32db7b9
commit
1821aff04e
70
src/vulkan.c
70
src/vulkan.c
@ -106,18 +106,64 @@ GLFWbool _glfwInitVulkan(void)
|
|||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_surface") == 0)
|
#if defined(_WIN32) || defined(WIN32)
|
||||||
_glfw.vk.KHR_surface = GLFW_TRUE;
|
if(_glfw.vk.KHR_surface && _glfw.vk.KHR_win32_surface)
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_win32_surface") == 0)
|
break;
|
||||||
_glfw.vk.KHR_win32_surface = GLFW_TRUE;
|
#else
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_xlib_surface") == 0)
|
if(_glfw.vk.KHR_surface && (_glfw.vk.KHR_xlib_surface || _glfw.vk.KHR_xcb_surface || _glfw.vk.KHR_wayland_surface || _glfw.vk.KHR_mir_surface))
|
||||||
_glfw.vk.KHR_xlib_surface = GLFW_TRUE;
|
break;
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_xcb_surface") == 0)
|
#endif
|
||||||
_glfw.vk.KHR_xcb_surface = GLFW_TRUE;
|
if(!_glfw.vk.KHR_surface)
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_wayland_surface") == 0)
|
{
|
||||||
_glfw.vk.KHR_wayland_surface = GLFW_TRUE;
|
if (strcmp(ep[i].extensionName, "VK_KHR_surface") == 0)
|
||||||
if (strcmp(ep[i].extensionName, "VK_KHR_mir_surface") == 0)
|
{
|
||||||
_glfw.vk.KHR_mir_surface = GLFW_TRUE;
|
_glfw.vk.KHR_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if defined(_WIN32) || defined(WIN32)
|
||||||
|
if(!_glfw.vk.KHR_win32_surface)
|
||||||
|
{
|
||||||
|
if (strcmp(ep[i].extensionName, "VK_KHR_win32_surface") == 0)
|
||||||
|
{
|
||||||
|
_glfw.vk.KHR_win32_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if(!_glfw.vk.KHR_xlib_surface)
|
||||||
|
{
|
||||||
|
if (strcmp(ep[i].extensionName, "VK_KHR_xlib_surface") == 0)
|
||||||
|
{
|
||||||
|
_glfw.vk.KHR_xlib_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_glfw.vk.KHR_xcb_surface)
|
||||||
|
{
|
||||||
|
if (strcmp(ep[i].extensionName, "VK_KHR_xcb_surface") == 0)
|
||||||
|
{
|
||||||
|
_glfw.vk.KHR_xcb_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_glfw.vk.KHR_wayland_surface)
|
||||||
|
{
|
||||||
|
if (strcmp(ep[i].extensionName, "VK_KHR_wayland_surface") == 0)
|
||||||
|
{
|
||||||
|
_glfw.vk.KHR_wayland_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_glfw.vk.KHR_mir_surface)
|
||||||
|
{
|
||||||
|
if (strcmp(ep[i].extensionName, "VK_KHR_mir_surface") == 0)
|
||||||
|
{
|
||||||
|
_glfw.vk.KHR_mir_surface = GLFW_TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
free(ep);
|
free(ep);
|
||||||
|
Loading…
Reference in New Issue
Block a user