GLInterface: Implement core and shared context creation for WGL

This commit is contained in:
Stenzek
2016-10-05 20:37:11 +10:00
parent 0212741574
commit 7353cae707
2 changed files with 409 additions and 65 deletions

View File

@ -14,6 +14,7 @@ public:
void Swap() override;
void* GetFuncAddress(const std::string& name) override;
bool Create(void* window_handle, bool core) override;
bool Create(cInterfaceBase* main_context) override;
bool MakeCurrent() override;
bool ClearCurrent() override;
void Shutdown() override;
@ -21,6 +22,15 @@ public:
void Update() override;
bool PeekMessages() override;
std::unique_ptr<cInterfaceBase> CreateSharedContext() override;
private:
static HGLRC CreateCoreContext(HDC dc, HGLRC share_context);
static bool CreatePBuffer(HDC onscreen_dc, int width, int height, HANDLE* pbuffer_handle,
HDC* pbuffer_dc);
HWND m_window_handle = nullptr;
HANDLE m_pbuffer_handle = nullptr;
HDC m_dc = nullptr;
HGLRC m_rc = nullptr;
};