summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd/emu_window
diff options
context:
space:
mode:
authorClément Gallet <clement.gallet@ens-lyon.org>2021-06-04 11:39:04 +0200
committerClément Gallet <clement.gallet@ens-lyon.org>2021-06-04 11:39:04 +0200
commit9ff8504452ee6cb1eefd61918ed61d6f6362cb31 (patch)
treec3d5004017d94b999121cf20069c74d699fa06ee /src/yuzu_cmd/emu_window
parentMerge pull request #6402 from Kelebek1/UI (diff)
downloadyuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar.gz
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar.bz2
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar.lz
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar.xz
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.tar.zst
yuzu-9ff8504452ee6cb1eefd61918ed61d6f6362cb31.zip
Diffstat (limited to 'src/yuzu_cmd/emu_window')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp15
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h3
2 files changed, 6 insertions, 12 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 3c49a300b..a3c513e3a 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
@@ -32,17 +32,17 @@
class SDLGLContext : public Core::Frontend::GraphicsContext {
public:
- explicit SDLGLContext() {
- // create a hidden window to make the shared context against
- window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0,
- SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL);
+ explicit SDLGLContext(SDL_Window* window) : window(window) {
context = SDL_GL_CreateContext(window);
}
~SDLGLContext() {
DoneCurrent();
SDL_GL_DeleteContext(context);
- SDL_DestroyWindow(window);
+ }
+
+ void SwapBuffers() override {
+ SDL_GL_SwapWindow(window);
}
void MakeCurrent() override {
@@ -114,9 +114,6 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste
exit(1);
}
- dummy_window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0,
- SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL);
-
SetWindowIcon();
if (fullscreen) {
@@ -159,5 +156,5 @@ EmuWindow_SDL2_GL::~EmuWindow_SDL2_GL() {
}
std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateSharedContext() const {
- return std::make_unique<SDLGLContext>();
+ return std::make_unique<SDLGLContext>(render_window);
}
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h
index dba5c293c..9e694d985 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h
@@ -20,9 +20,6 @@ public:
std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override;
private:
- /// Fake hidden window for the core context
- SDL_Window* dummy_window{};
-
/// Whether the GPU and driver supports the OpenGL extension required
bool SupportsRequiredGLExtensions();