emu_window_sdl2_gl.h 1016 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <memory>
  5. #include "core/frontend/emu_window.h"
  6. #include "yuzu_cmd/emu_window/emu_window_sdl2.h"
  7. namespace Core {
  8. class System;
  9. }
  10. namespace InputCommon {
  11. class InputSubsystem;
  12. }
  13. class EmuWindow_SDL2_GL final : public EmuWindow_SDL2 {
  14. public:
  15. explicit EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_,
  16. bool fullscreen);
  17. ~EmuWindow_SDL2_GL();
  18. std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override;
  19. private:
  20. /// Whether the GPU and driver supports the OpenGL extension required
  21. bool SupportsRequiredGLExtensions();
  22. using SDL_GLContext = void*;
  23. /// The OpenGL context associated with the window
  24. SDL_GLContext window_context;
  25. /// The OpenGL context associated with the core
  26. std::unique_ptr<Core::Frontend::GraphicsContext> core_context;
  27. };