mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Refactoring and cleanup of GLInterface (now GLContext)
This commit is contained in:
@ -10,35 +10,39 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/GL/GLInterface/X11_Util.h"
|
||||
#include "Common/GL/GLInterfaceBase.h"
|
||||
#include "Common/GL/GLContext.h"
|
||||
#include "Common/GL/GLX11Window.h"
|
||||
|
||||
class cInterfaceGLX : public cInterfaceBase
|
||||
class GLContextGLX : public GLContext
|
||||
{
|
||||
private:
|
||||
Window m_host_window;
|
||||
cX11Window XWindow;
|
||||
Display* dpy;
|
||||
Window win;
|
||||
GLXContext ctx;
|
||||
GLXFBConfig fbconfig;
|
||||
bool m_has_handle;
|
||||
public:
|
||||
bool IsHeadless() const override;
|
||||
|
||||
std::unique_ptr<GLContext> CreateSharedContext() override;
|
||||
void Shutdown() override;
|
||||
|
||||
bool MakeCurrent() override;
|
||||
bool ClearCurrent() override;
|
||||
|
||||
void SwapInterval(int Interval) override;
|
||||
void Swap() override;
|
||||
|
||||
void* GetFuncAddress(const std::string& name) override;
|
||||
|
||||
protected:
|
||||
bool Initialize(void* window_handle, bool stereo, bool core) override;
|
||||
bool Initialize(GLContext* main_context) override;
|
||||
|
||||
Display* m_display = nullptr;
|
||||
std::unique_ptr<GLX11Window> m_render_window;
|
||||
|
||||
GLXDrawable m_drawable = {};
|
||||
GLXContext m_context = {};
|
||||
GLXFBConfig m_fbconfig = {};
|
||||
bool m_supports_pbuffer = false;
|
||||
GLXPbufferSGIX m_pbuffer = 0;
|
||||
std::vector<int> m_attribs;
|
||||
|
||||
bool CreateWindowSurface();
|
||||
bool CreateWindowSurface(Window window_handle);
|
||||
void DestroyWindowSurface();
|
||||
|
||||
public:
|
||||
friend class cX11Window;
|
||||
void SwapInterval(int Interval) override;
|
||||
void Swap() override;
|
||||
void* GetFuncAddress(const std::string& name) override;
|
||||
bool Create(void* window_handle, bool stereo, bool core) override;
|
||||
bool Create(cInterfaceBase* main_context) override;
|
||||
bool MakeCurrent() override;
|
||||
bool ClearCurrent() override;
|
||||
void Shutdown() override;
|
||||
std::unique_ptr<cInterfaceBase> CreateSharedContext() override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user