Refactoring and cleanup of GLInterface (now GLContext)

This commit is contained in:
Stenzek
2018-10-03 23:02:45 +10:00
parent 74b82bab3b
commit 134d967be2
39 changed files with 741 additions and 690 deletions

View File

@ -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;
};