Implement shared contexts in the EGL context.

This is being implemented here first under EGL since the infrastructure is already in place for this due to the Android code requiring some bits.
The rest of the interfaces will come in a little bit.

This will be required for threaded shader compiling in the near future.
This commit is contained in:
Ryan Houdek
2016-01-21 19:03:58 -06:00
parent fdf6fb47e0
commit aed693eded
3 changed files with 102 additions and 30 deletions

View File

@ -23,6 +23,8 @@ protected:
// Window dimensions.
u32 s_backbuffer_width = 0;
u32 s_backbuffer_height = 0;
bool m_core = false;
bool m_is_shared = false;
GLInterfaceMode s_opengl_mode = GLInterfaceMode::MODE_DETECT;
public:
@ -32,6 +34,7 @@ public:
virtual GLInterfaceMode GetMode() { return s_opengl_mode; }
virtual void* GetFuncAddress(const std::string& name) { return nullptr; }
virtual bool Create(void *window_handle, bool core = true) { return true; }
virtual bool Create(cInterfaceBase* main_context) { return true; }
virtual bool MakeCurrent() { return true; }
virtual bool ClearCurrent() { return true; }
virtual void Shutdown() {}
@ -44,6 +47,7 @@ public:
virtual bool PeekMessages() { return false; }
virtual void UpdateHandle(void* window_handle) {}
virtual void UpdateSurface() {}
virtual std::unique_ptr<cInterfaceBase> CreateSharedContext() { return nullptr; }
};
extern std::unique_ptr<cInterfaceBase> GLInterface;