diff options
author | James Rowe <jroweboy@gmail.com> | 2020-03-30 22:52:46 +0200 |
---|---|---|
committer | James Rowe <jroweboy@gmail.com> | 2020-03-30 22:57:42 +0200 |
commit | f1da3ec584e5956c8090ac9a958447e4f5e78da2 (patch) | |
tree | e68a313e919cfce944bf9857038502b97d4b35e2 /src/yuzu_cmd | |
parent | Address review and fix broken yuzu-tester build (diff) | |
download | yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar.gz yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar.bz2 yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar.lz yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar.xz yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.tar.zst yuzu-f1da3ec584e5956c8090ac9a958447e4f5e78da2.zip |
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index ee61179a0..3522dcf6d 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -37,16 +37,24 @@ public: } void MakeCurrent() override { - SDL_GL_MakeCurrent(window, context); + if (is_current) { + return; + } + is_current = SDL_GL_MakeCurrent(window, context) == 0; } void DoneCurrent() override { + if (!is_current) { + return; + } SDL_GL_MakeCurrent(window, nullptr); + is_current = false; } private: SDL_Window* window; SDL_GLContext context; + bool is_current = false; }; bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { |