Add unity build support
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace Nz::GL
|
||||
{
|
||||
thread_local const Context* s_currentContext = nullptr;
|
||||
thread_local const Context* s_currentGLContext = nullptr;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace Nz::GL
|
||||
{
|
||||
return [](Args... args) -> Ret
|
||||
{
|
||||
const Context* context = s_currentContext; //< pay TLS cost once
|
||||
const Context* context = s_currentGLContext; //< pay TLS cost once
|
||||
assert(context);
|
||||
|
||||
FuncType funcPtr = reinterpret_cast<FuncType>(context->GetFunctionByIndex(FuncIndex));
|
||||
@@ -755,12 +755,12 @@ namespace Nz::GL
|
||||
|
||||
const Context* Context::GetCurrentContext()
|
||||
{
|
||||
return s_currentContext;
|
||||
return s_currentGLContext;
|
||||
}
|
||||
|
||||
bool Context::SetCurrentContext(const Context* context)
|
||||
{
|
||||
const Context*& currentContext = s_currentContext; //< Pay TLS cost once
|
||||
const Context*& currentContext = s_currentGLContext; //< Pay TLS cost once
|
||||
if (currentContext == context)
|
||||
return true;
|
||||
|
||||
@@ -810,7 +810,7 @@ namespace Nz::GL
|
||||
|
||||
void Context::NotifyContextDestruction(Context* context)
|
||||
{
|
||||
const Context*& currentContext = s_currentContext; //< Pay TLS cost only once
|
||||
const Context*& currentContext = s_currentGLContext; //< Pay TLS cost only once
|
||||
if (currentContext == context)
|
||||
currentContext = nullptr;
|
||||
}
|
||||
|
||||
@@ -337,3 +337,7 @@ namespace Nz::GL
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -236,3 +236,7 @@ namespace Nz::GL
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Nz::GL
|
||||
if (!ChooseConfig(configs.data(), configs.size(), &configCount))
|
||||
return false;
|
||||
|
||||
::Window winHandle = static_cast<::Window>(window.x11.window);
|
||||
::NativeWindowType winHandle = static_cast<::NativeWindowType>(window.x11.window);
|
||||
|
||||
std::size_t configIndex = 0;
|
||||
for (; configIndex < configCount; ++configIndex)
|
||||
|
||||
@@ -391,3 +391,5 @@ namespace Nz::GL
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
|
||||
@@ -128,3 +128,5 @@ namespace Nz::GL
|
||||
return func;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
|
||||
@@ -83,3 +83,5 @@ namespace Nz::GL
|
||||
m_ownedWindow.reset();
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
|
||||
Reference in New Issue
Block a user