summaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-01-23 21:20:08 -0500
committerGitHub <noreply@github.com>2019-01-23 21:20:08 -0500
commitf574d324e7f8692ebff0aaa17c416f4840feda5c (patch)
treeafd89a9ec560c65070c37bbd0151c5327cc71e8a /src/yuzu/main.cpp
parent9be3fedcaa9f792db93143e60f8b6f4bd02e43f1 (diff)
parent045b0b70b67b7bc631c69625e6e67a8e8a5c3a58 (diff)
Merge pull request #2054 from bunnei/scope-context-refactor
frontend: Refactor ScopeAcquireWindowContext out of renderer_opengl.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index ca6ddebcb..ab403b3ac 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: