mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 05:01:41 +00:00
- destroy SDL window on Vulkan to OpenGL fallback
https://forum.zdoom.org/viewtopic.php?t=64412
This commit is contained in:
parent
23e2b1c0c0
commit
6b5f7b4763
1 changed files with 15 additions and 4 deletions
|
@ -145,6 +145,14 @@ namespace Priv
|
|||
}
|
||||
}
|
||||
|
||||
void DestroyWindow()
|
||||
{
|
||||
assert(Priv::window != nullptr);
|
||||
|
||||
SDL_DestroyWindow(Priv::window);
|
||||
Priv::window = nullptr;
|
||||
}
|
||||
|
||||
void SetupPixelFormat(int multisample, const int *glver)
|
||||
{
|
||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
|
||||
|
@ -276,6 +284,11 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer ()
|
|||
}
|
||||
catch (CRecoverableError const&)
|
||||
{
|
||||
if (Priv::window != nullptr)
|
||||
{
|
||||
Priv::DestroyWindow();
|
||||
}
|
||||
|
||||
Priv::vulkanEnabled = false;
|
||||
}
|
||||
}
|
||||
|
@ -428,8 +441,7 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void *hMonitor, bool fullscreen)
|
|||
GLContext = SDL_GL_CreateContext(Priv::window);
|
||||
if (GLContext == nullptr)
|
||||
{
|
||||
SDL_DestroyWindow(Priv::window);
|
||||
Priv::window = nullptr;
|
||||
Priv::DestroyWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -447,8 +459,7 @@ SystemGLFrameBuffer::~SystemGLFrameBuffer ()
|
|||
SDL_GL_DeleteContext(GLContext);
|
||||
}
|
||||
|
||||
SDL_DestroyWindow(Priv::window);
|
||||
Priv::window = nullptr;
|
||||
Priv::DestroyWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue