diff options
author | bunnei <bunneidev@gmail.com> | 2019-01-07 23:16:01 -0500 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-01-23 19:19:23 -0500 |
commit | 045b0b70b67b7bc631c69625e6e67a8e8a5c3a58 (patch) | |
tree | 872f5d8013e2e0fd3a2f6ecff86b4ad64fbf573d /src/yuzu/main.cpp | |
parent | d5a4707f659010061dd07a2a7af4e1c88a8796ae (diff) |
frontend: Refactor ScopeAcquireWindowContext out of renderer_opengl.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2c3e27c2e7..fc584637da 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -14,6 +14,7 @@ #include "configuration/configure_per_general.h" #include "core/file_sys/vfs.h" #include "core/file_sys/vfs_real.h" +#include "core/frontend/scope_acquire_window_context.h" #include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/am/applets/applets.h" #include "core/hle/service/hid/controllers/npad.h" @@ -747,13 +748,15 @@ bool GMainWindow::LoadROM(const QString& filename) { ShutdownGame(); render_window->InitRenderTarget(); - render_window->MakeCurrent(); - if (!gladLoadGL()) { - QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3 Core!"), - tr("Your GPU may not support OpenGL 4.3, or you do not " - "have the latest graphics driver.")); - return false; + { + Core::Frontend::ScopeAcquireWindowContext acquire_context{*render_window}; + if (!gladLoadGL()) { + QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3 Core!"), + tr("Your GPU may not support OpenGL 4.3, or you do not " + "have the latest graphics driver.")); + return false; + } } QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions(); @@ -794,8 +797,6 @@ bool GMainWindow::LoadROM(const QString& filename) { "wiki</a>. This message will not be shown again.")); } - render_window->DoneCurrent(); - if (result != Core::System::ResultStatus::Success) { switch (result) { case Core::System::ResultStatus::ErrorGetLoader: |