OpenGL: Link contexts to device

This commit is contained in:
Lynix
2020-04-19 15:33:36 +02:00
parent bd6924d66d
commit 349e915e10
12 changed files with 78 additions and 21 deletions

View File

@@ -26,7 +26,7 @@ namespace Nz::GL
class WGLContext : public Context
{
public:
WGLContext(const WGLLoader& loader);
inline WGLContext(const OpenGLDevice* device, const WGLLoader& loader);
WGLContext(const WGLContext&) = delete;
WGLContext(WGLContext&&) = delete;
~WGLContext();

View File

@@ -7,6 +7,12 @@
namespace Nz::GL
{
inline GL::WGLContext::WGLContext(const OpenGLDevice* device, const WGLLoader& loader) :
Context(device),
m_loader(loader)
{
}
inline bool WGLContext::HasPlatformExtension(const std::string& str) const
{
return m_supportedPlatformExtensions.find(str) != m_supportedPlatformExtensions.end();

View File

@@ -24,8 +24,8 @@ namespace Nz::GL
WGLLoader(DynLib& openglLib);
~WGLLoader() = default;
std::unique_ptr<Context> CreateContext(const ContextParams& params, Context* shareContext) const override;
std::unique_ptr<Context> CreateContext(const ContextParams& params, WindowHandle handle, Context* shareContext) const override;
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, Context* shareContext) const override;
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, WindowHandle handle, Context* shareContext) const override;
GLFunction LoadFunction(const char* name) const override;