diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 15 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h | 3 |
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..837a44be7 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 @@ | |||
| 32 | 32 | ||
| 33 | class SDLGLContext : public Core::Frontend::GraphicsContext { | 33 | class SDLGLContext : public Core::Frontend::GraphicsContext { |
| 34 | public: | 34 | public: |
| 35 | explicit SDLGLContext() { | 35 | explicit SDLGLContext(SDL_Window* window_) : window{window_} { |
| 36 | // create a hidden window to make the shared context against | ||
| 37 | window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, | ||
| 38 | SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL); | ||
| 39 | context = SDL_GL_CreateContext(window); | 36 | context = SDL_GL_CreateContext(window); |
| 40 | } | 37 | } |
| 41 | 38 | ||
| 42 | ~SDLGLContext() { | 39 | ~SDLGLContext() { |
| 43 | DoneCurrent(); | 40 | DoneCurrent(); |
| 44 | SDL_GL_DeleteContext(context); | 41 | SDL_GL_DeleteContext(context); |
| 45 | SDL_DestroyWindow(window); | 42 | } |
| 43 | |||
| 44 | void SwapBuffers() override { | ||
| 45 | SDL_GL_SwapWindow(window); | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void MakeCurrent() override { | 48 | void MakeCurrent() override { |
| @@ -114,9 +114,6 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste | |||
| 114 | exit(1); | 114 | exit(1); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | dummy_window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, | ||
| 118 | SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL); | ||
| 119 | |||
| 120 | SetWindowIcon(); | 117 | SetWindowIcon(); |
| 121 | 118 | ||
| 122 | if (fullscreen) { | 119 | if (fullscreen) { |
| @@ -159,5 +156,5 @@ EmuWindow_SDL2_GL::~EmuWindow_SDL2_GL() { | |||
| 159 | } | 156 | } |
| 160 | 157 | ||
| 161 | std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateSharedContext() const { | 158 | std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateSharedContext() const { |
| 162 | return std::make_unique<SDLGLContext>(); | 159 | return std::make_unique<SDLGLContext>(render_window); |
| 163 | } | 160 | } |
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: | |||
| 20 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; | 20 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; |
| 21 | 21 | ||
| 22 | private: | 22 | private: |
| 23 | /// Fake hidden window for the core context | ||
| 24 | SDL_Window* dummy_window{}; | ||
| 25 | |||
| 26 | /// Whether the GPU and driver supports the OpenGL extension required | 23 | /// Whether the GPU and driver supports the OpenGL extension required |
| 27 | bool SupportsRequiredGLExtensions(); | 24 | bool SupportsRequiredGLExtensions(); |
| 28 | 25 | ||