Skip to content

Commit

Permalink
SDL: Fix issue with vulkan-to-opengl fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Feb 10, 2018
1 parent 081e15d commit d9af90e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions SDL/SDLMain.cpp
Expand Up @@ -615,16 +615,13 @@ int main(int argc, char *argv[]) {
GraphicsContext *graphicsContext = nullptr;
SDL_Window *window = nullptr;

bool useEmuThread;

std::string error_message;
if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) {
SDLGLGraphicsContext *ctx = new SDLGLGraphicsContext();
if (ctx->Init(window, x, y, mode, &error_message) != 0) {
printf("GL init error '%s'\n", error_message.c_str());
}
graphicsContext = ctx;
useEmuThread = true;
} else if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) {
SDLVulkanGraphicsContext *ctx = new SDLVulkanGraphicsContext();
if (!ctx->Init(window, x, y, mode, &error_message)) {
Expand All @@ -638,9 +635,10 @@ int main(int argc, char *argv[]) {
} else {
graphicsContext = ctx;
}
useEmuThread = false;
}

bool useEmuThread = g_Config.iGPUBackend == (int)GPUBackend::OPENGL;

SDL_SetWindowTitle(window, (app_name_nice + " " + PPSSPP_GIT_VERSION).c_str());

// Since we render from the main thread, there's nothing done here, but we call it to avoid confusion.
Expand Down

0 comments on commit d9af90e

Please sign in to comment.