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

@@ -4,8 +4,11 @@
#include <Nazara/OpenGLRenderer/Wrapper/Context.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/OpenGLRenderer/OpenGLDevice.hpp>
#include <Nazara/OpenGLRenderer/Wrapper/Loader.hpp>
#include <sstream>
#include <stdexcept>
#include <Nazara/OpenGLRenderer/Debug.hpp>
@@ -13,6 +16,12 @@ namespace Nz::GL
{
thread_local const Context* s_currentContext = nullptr;
Context::~Context()
{
if (m_device)
m_device->NotifyContextDestruction(*this);
}
bool Context::Initialize(const ContextParams& params)
{