mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
GLContext: Remove global context pointer
This commit is contained in:
@ -11,15 +11,18 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
|
||||
class GLContext;
|
||||
|
||||
class AbstractTexture;
|
||||
struct WindowSystemInfo;
|
||||
|
||||
class SWOGLWindow
|
||||
{
|
||||
public:
|
||||
static void Init(const WindowSystemInfo& wsi);
|
||||
static void Shutdown();
|
||||
void Prepare();
|
||||
~SWOGLWindow();
|
||||
|
||||
GLContext* GetContext() const { return m_gl_context.get(); }
|
||||
bool IsHeadless() const;
|
||||
|
||||
// Will be printed on the *next* image
|
||||
void PrintText(const std::string& text, int x, int y, u32 color);
|
||||
@ -27,10 +30,13 @@ public:
|
||||
// Image to show, will be swapped immediately
|
||||
void ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region);
|
||||
|
||||
static std::unique_ptr<SWOGLWindow> s_instance;
|
||||
static std::unique_ptr<SWOGLWindow> Create(const WindowSystemInfo& wsi);
|
||||
|
||||
private:
|
||||
SWOGLWindow() {}
|
||||
SWOGLWindow();
|
||||
|
||||
bool Initialize(const WindowSystemInfo& wsi);
|
||||
|
||||
struct TextData
|
||||
{
|
||||
std::string text;
|
||||
@ -39,7 +45,9 @@ private:
|
||||
};
|
||||
std::vector<TextData> m_text;
|
||||
|
||||
bool m_init{false};
|
||||
u32 m_image_program = 0;
|
||||
u32 m_image_texture = 0;
|
||||
u32 m_image_vao = 0;
|
||||
|
||||
u32 m_image_program, m_image_texture, m_image_vao;
|
||||
std::unique_ptr<GLContext> m_gl_context;
|
||||
};
|
||||
|
Reference in New Issue
Block a user