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:
parent
fcaf5adb25
commit
e2e3d949c7
1 changed files with 4 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue