Don't use a dummy vulkan window when initializing SDL backend
This commit is contained in:
parent
b605685f7a
commit
7a53ce8db4
1 changed files with 8 additions and 7 deletions
|
@ -350,21 +350,22 @@ void platform::initialize_context(const GFXContext context) {
|
|||
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VULKAN
|
||||
if(context == GFXContext::Vulkan) {
|
||||
SDL_Vulkan_LoadLibrary(nullptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void* platform::get_context_information() {
|
||||
#ifdef ENABLE_VULKAN
|
||||
if(gfx_interface->required_context() == GFXContext::Vulkan) {
|
||||
// dummy window
|
||||
auto dummy = SDL_CreateWindow("", 0, 0, 1, 1, SDL_WINDOW_VULKAN);
|
||||
|
||||
unsigned int count = 0;
|
||||
SDL_Vulkan_GetInstanceExtensions(dummy, &count, nullptr);
|
||||
SDL_Vulkan_GetInstanceExtensions(nullptr, &count, nullptr);
|
||||
|
||||
std::vector<const char*> extensions(count);
|
||||
SDL_Vulkan_GetInstanceExtensions(dummy, &count, extensions.data());
|
||||
|
||||
SDL_DestroyWindow(dummy);
|
||||
SDL_Vulkan_GetInstanceExtensions(nullptr, &count, extensions.data());
|
||||
|
||||
auto info = new vulkan_information();
|
||||
info->surface_extensions = extensions;
|
||||
|
|
Reference in a new issue