mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-07-13 09:51:05 +00:00
Default to DirectX renderer if OpenGL can't be ran
This commit is contained in:
parent
e87d118063
commit
2e9e6644ca
3 changed files with 19 additions and 0 deletions
|
|
@ -836,6 +836,18 @@ static void gfx_opengl_init(void) {
|
|||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
bool gfx_opengl_check_compatibility(void) {
|
||||
// check GL version
|
||||
int vmajor = 0;
|
||||
int vminor = 0;
|
||||
bool is_es = false;
|
||||
gl_get_version(&vmajor, &vminor, &is_es);
|
||||
if (vmajor < 2 && vminor < 1 && !is_es)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gfx_opengl_on_resize(void) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,6 @@
|
|||
|
||||
extern struct GfxRenderingAPI gfx_opengl_api;
|
||||
|
||||
bool gfx_opengl_check_compatibility(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -221,6 +221,11 @@ static void select_graphics_backend(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
if (configGraphicsBackend == GAPI_GL && !gfx_opengl_check_compatibility()) {
|
||||
configGraphicsBackend = GAPI_D3D11;
|
||||
}
|
||||
#endif
|
||||
int backend = configGraphicsBackend;
|
||||
#if defined(_WIN32)
|
||||
if (gCLIOpts.backend != -1) { backend = gCLIOpts.backend; }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue