mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 13:46:37 +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
72
src/vulkan.c
72
src/vulkan.c
@ -104,20 +104,66 @@ GLFWbool _glfwInitVulkan(void)
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_surface") == 0)
|
||||
_glfw.vk.KHR_surface = GLFW_TRUE;
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_win32_surface") == 0)
|
||||
_glfw.vk.KHR_win32_surface = GLFW_TRUE;
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_xlib_surface") == 0)
|
||||
_glfw.vk.KHR_xlib_surface = GLFW_TRUE;
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_xcb_surface") == 0)
|
||||
_glfw.vk.KHR_xcb_surface = GLFW_TRUE;
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_wayland_surface") == 0)
|
||||
_glfw.vk.KHR_wayland_surface = GLFW_TRUE;
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_mir_surface") == 0)
|
||||
_glfw.vk.KHR_mir_surface = GLFW_TRUE;
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
if(_glfw.vk.KHR_surface && _glfw.vk.KHR_win32_surface)
|
||||
break;
|
||||
#else
|
||||
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))
|
||||
break;
|
||||
#endif
|
||||
if(!_glfw.vk.KHR_surface)
|
||||
{
|
||||
if (strcmp(ep[i].extensionName, "VK_KHR_surface") == 0)
|
||||
{
|
||||
_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);
|
||||
|
Loading…
Reference in New Issue
Block a user