GLInterface: Support shared contexts in GLX

This commit is contained in:
Ryan Houdek
2016-01-23 04:21:53 -06:00
committed by Stenzek
parent 621287e7eb
commit 01ae02482c
2 changed files with 149 additions and 44 deletions

View File

@ -5,7 +5,10 @@
#pragma once
#include <GL/glx.h>
#include <GL/glxext.h>
#include <memory>
#include <string>
#include <vector>
#include "Common/GL/GLInterface/X11_Util.h"
#include "Common/GL/GLInterfaceBase.h"
@ -13,11 +16,19 @@
class cInterfaceGLX : public cInterfaceBase
{
private:
Window m_host_window;
cX11Window XWindow;
Display* dpy;
Window win;
GLXContext ctx;
GLXFBConfig fbconfig;
bool m_has_handle;
bool m_supports_pbuffer = false;
GLXPbufferSGIX m_pbuffer = 0;
std::vector<int> m_attribs;
bool CreateWindowSurface();
void DestroyWindowSurface();
public:
friend class cX11Window;
@ -25,7 +36,9 @@ public:
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;
};