emu_window_sdl2_gl.h 995 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include "core/frontend/emu_window.h"
  7. #include "yuzu_cmd/emu_window/emu_window_sdl2.h"
  8. class EmuWindow_SDL2_GL final : public EmuWindow_SDL2 {
  9. public:
  10. explicit EmuWindow_SDL2_GL(bool fullscreen);
  11. ~EmuWindow_SDL2_GL();
  12. /// Swap buffers to display the next frame
  13. void SwapBuffers() override;
  14. /// Makes the graphics context current for the caller thread
  15. void MakeCurrent() override;
  16. /// Releases the GL context from the caller thread
  17. void DoneCurrent() override;
  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 gl_context;
  25. };