Skip to content

Commit

Permalink
Fix opengl api not getting used correctly (Kenix3#134)
Browse files Browse the repository at this point in the history
* fix opengl api not getting used correctly

* fix broken if
  • Loading branch information
Archez authored Mar 1, 2023
1 parent 8b6ea36 commit 80e558c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/core/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,14 @@ void Window::InitializeWindowManager(std::string_view gfxBackend, std::string_vi
#endif
#if defined(ENABLE_OPENGL) || defined(__APPLE__)
if (gfxBackend == "sdl") {
if (gfxApi == "OpenGL") {
mRenderingApi = &gfx_opengl_api;
}
mRenderingApi = &gfx_opengl_api;
mWindowManagerApi = &gfx_sdl;
#ifdef __APPLE__
else if (gfxApi == "Metal") {
if (gfxApi == "Metal" && Metal_IsSupported()) {
mRenderingApi = &gfx_metal_api;
}
#endif
mWindowManagerApi = &gfx_sdl;
return;
}
#if defined(__linux__) && defined(X11_SUPPORTED)
if (gfxBackend == "glx") {
Expand Down
2 changes: 1 addition & 1 deletion src/menu/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const char* filters[3] = {

std::vector<std::pair<const char*, const char*>> renderingBackends = {
#ifdef _WIN32
{ "Dx11", "DirectX" },
{ "dx11", "DirectX" },
#endif
#ifndef __WIIU__
{ "sdl", "OpenGL" }
Expand Down

0 comments on commit 80e558c

Please sign in to comment.