1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OpenGL: Use C++ thread_local instead of JUCE ThreadLocal

This commit is contained in:
reuk 2024-10-23 19:17:33 +01:00
parent fcaf5adb25
commit e2e3d949c7
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -1351,16 +1351,16 @@ OpenGLContext* OpenGLContext::getContextAttachedTo (Component& c) noexcept
return nullptr;
}
static ThreadLocalValue<OpenGLContext*> currentThreadActiveContext;
thread_local OpenGLContext* currentThreadActiveContext = nullptr;
OpenGLContext* OpenGLContext::getCurrentContext()
{
return currentThreadActiveContext.get();
return currentThreadActiveContext;
}
bool OpenGLContext::makeActive() const noexcept
{
auto& current = currentThreadActiveContext.get();
auto& current = currentThreadActiveContext;
if (nativeContext != nullptr && nativeContext->makeActive())
{
@ -1380,7 +1380,7 @@ bool OpenGLContext::isActive() const noexcept
void OpenGLContext::deactivateCurrentContext()
{
NativeContext::deactivateCurrentContext();
currentThreadActiveContext.get() = nullptr;
currentThreadActiveContext = nullptr;
}
void OpenGLContext::triggerRepaint()