4916: Try default opengl settings first, when vulkan fails r=def- a=Jupeyy

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2022-03-30 12:59:21 +00:00 committed by GitHub
commit 8cd78a8325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -885,6 +885,15 @@ int CGraphicsBackend_SDL_GL::Init(const char *pName, int *pScreen, int *pWidth,
{
if(m_BackendType == BACKEND_TYPE_VULKAN)
{
// try default opengl settings
str_copy(g_Config.m_GfxBackend, "OpenGL", std::size(g_Config.m_GfxBackend));
g_Config.m_GfxGLMajor = 3;
g_Config.m_GfxGLMinor = 0;
g_Config.m_GfxGLPatch = 0;
// do another analysis round too, just in case
g_Config.m_Gfx3DTextureAnalysisDone = 0;
g_Config.m_GfxDriverIsBlocked = 0;
SDL_setenv("DDNET_DRIVER", "OpenGL", 1);
m_BackendType = DetectBackend();
}