mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
Fail Vulkan surface creation if window has context
OpenGL / OpenGL ES cannot share presentation on a window with Vulkan. This adds an error to `glfwCreateWindowSurface` when it is called on a window without the GLFW_CLIENT_API hint set to GLFW_NO_API. This prevents undefined bahevior and hard to debug crashes. Fixes #1194. Closes #1205.
This commit is contained in:
committed by
Camilla Löwy
parent
525ad7bfb8
commit
8a8eefa0d8
@@ -230,6 +230,10 @@ if (err)
|
||||
}
|
||||
@endcode
|
||||
|
||||
If an OpenGL or OpenGL ES context was created on the window, the context has
|
||||
ownership of the presentation on the window and a Vulkan surface cannot be
|
||||
created.
|
||||
|
||||
It is your responsibility to destroy the surface. GLFW does not destroy it for
|
||||
you. Call `vkDestroySurfaceKHR` function from the same extension to destroy it.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user