Fixed bug with threads and OpenGL contexts
Former-commit-id: 044923d57873f4e1a1eb4001395a83dbe97aabed
This commit is contained in:
parent
0e3a4fa90b
commit
3b88cd936c
|
|
@ -167,7 +167,7 @@ bool NzContext::Create(const NzContextParameters& parameters)
|
|||
if (m_parameters.antialiasingLevel > 0)
|
||||
glEnable(GL_MULTISAMPLE);
|
||||
|
||||
if (NzOpenGL::IsSupported(nzOpenGLExtension_DebugOutput) && m_parameters.debugMode)
|
||||
if (m_parameters.debugMode && NzOpenGL::IsSupported(nzOpenGLExtension_DebugOutput))
|
||||
{
|
||||
glDebugMessageCallback(&DebugCallback, this);
|
||||
|
||||
|
|
@ -186,13 +186,9 @@ void NzContext::Destroy()
|
|||
if (m_impl)
|
||||
{
|
||||
NotifyDestroy();
|
||||
NzOpenGL::OnContextDestruction(this);
|
||||
|
||||
if (currentContext == this)
|
||||
{
|
||||
NzContextImpl::Desactivate();
|
||||
currentContext = nullptr;
|
||||
}
|
||||
NzOpenGL::OnContextDestruction(this);
|
||||
SetActive(false);
|
||||
|
||||
m_impl->Destroy();
|
||||
delete m_impl;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace
|
|||
|
||||
std::set<NzString> s_openGLextensionSet;
|
||||
std::unordered_map<NzContext*, ContextStates> s_contexts;
|
||||
ContextStates* s_contextStates = nullptr;
|
||||
thread_local ContextStates* s_contextStates = nullptr;
|
||||
const char* s_rendererName = nullptr;
|
||||
const char* s_vendorName = nullptr;
|
||||
bool s_initialized = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue