video: Add a hint to allow Vulkan surfaces on foreign windows

This commit is contained in:
Ethan Lee authored and Sam Lantinga committed 2022-03-17 14:25:55 -07:00
1 parent ecaa22cbe6
commit 0bf8ccfb60
2 files changed
+21

No files matched your search

+10
View File
@@ -1703,6 +1703,16 @@ SDL_CreateWindowFrom(const void *data)
}
_this->windows = window;
#if SDL_VIDEO_VULKAN
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN, SDL_FALSE)) {
window->flags |= SDL_WINDOW_VULKAN;
if (SDL_Vulkan_LoadLibrary(NULL) < 0) {
SDL_DestroyWindow(window);
return NULL;
}
}
#endif
if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
SDL_DestroyWindow(window);
return NULL;