SWOGLWindow.h 805 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2015 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <memory>
  5. #include "Common/CommonTypes.h"
  6. #include "Common/MathUtil.h"
  7. class AbstractTexture;
  8. class GLContext;
  9. struct WindowSystemInfo;
  10. class SWOGLWindow
  11. {
  12. public:
  13. ~SWOGLWindow();
  14. GLContext* GetContext() const { return m_gl_context.get(); }
  15. bool IsHeadless() const;
  16. // Image to show, will be swapped immediately
  17. void ShowImage(const AbstractTexture* image, const MathUtil::Rectangle<int>& xfb_region);
  18. static std::unique_ptr<SWOGLWindow> Create(const WindowSystemInfo& wsi);
  19. private:
  20. SWOGLWindow();
  21. bool Initialize(const WindowSystemInfo& wsi);
  22. u32 m_image_program = 0;
  23. u32 m_image_texture = 0;
  24. u32 m_image_vao = 0;
  25. std::unique_ptr<GLContext> m_gl_context;
  26. };