Add unity build support

This commit is contained in:
Jérôme Leclercq
2022-03-15 08:26:57 +01:00
parent 0a4fd8f56d
commit 6bd9f1a9e4
109 changed files with 964 additions and 680 deletions

View File

@@ -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;
}

View File

@@ -337,3 +337,7 @@ namespace Nz::GL
return true;
}
}
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Core/AntiWindows.hpp>
#endif

View File

@@ -236,3 +236,7 @@ namespace Nz::GL
return false;
}
}
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Core/AntiWindows.hpp>
#endif

View File

@@ -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)

View File

@@ -391,3 +391,5 @@ namespace Nz::GL
return true;
}
}
#include <Nazara/Core/AntiWindows.hpp>

View File

@@ -128,3 +128,5 @@ namespace Nz::GL
return func;
}
}
#include <Nazara/Core/AntiWindows.hpp>

View File

@@ -83,3 +83,5 @@ namespace Nz::GL
m_ownedWindow.reset();
}
}
#include <Nazara/Core/AntiWindows.hpp>