Forgot to commit this file

This commit is contained in:
SirLynix 2022-12-06 09:08:17 +01:00 committed by Jérôme Leclercq
parent 5b3703347f
commit b379518479
1 changed files with 12 additions and 2 deletions

View File

@ -125,24 +125,34 @@ namespace Nz
m_referenceContext.reset();
}
std::unique_ptr<GL::Context> OpenGLDevice::CreateContext(GL::ContextParams params) const
std::shared_ptr<GL::Context> OpenGLDevice::CreateContext([[maybe_unused]] GL::ContextParams params) const
{
#ifdef NAZARA_PLATFORM_WEB
// WebGL doesn't support context sharing and we support only one canvas, return the reference context
return m_referenceContext;
#else
params.type = m_referenceContext->GetParams().type;
auto contextPtr = m_loader.CreateContext(this, params, m_referenceContext.get());
m_contexts.insert(contextPtr.get());
return contextPtr;
#endif
}
std::unique_ptr<GL::Context> OpenGLDevice::CreateContext(GL::ContextParams params, WindowHandle handle) const
std::shared_ptr<GL::Context> OpenGLDevice::CreateContext([[maybe_unused]] GL::ContextParams params, [[maybe_unused]] WindowHandle handle) const
{
#ifdef NAZARA_PLATFORM_WEB
// WebGL doesn't support context sharing and we support only one canvas, return the reference context
return m_referenceContext;
#else
params.type = m_referenceContext->GetParams().type;
auto contextPtr = m_loader.CreateContext(this, params, handle, m_referenceContext.get());
m_contexts.insert(contextPtr.get());
return contextPtr;
#endif
}
const RenderDeviceInfo& OpenGLDevice::GetDeviceInfo() const