Split error macro into two versions (format vs non-formating) to allow format checking at compile-time
This commit is contained in:
@@ -369,13 +369,13 @@ namespace Nz::GL
|
||||
// Validate framebuffer completeness
|
||||
if (GLenum checkResult = m_blitFramebuffers->drawFBO.Check(); checkResult != GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
NazaraError("Blit draw FBO is incomplete: {0}", TranslateOpenGLError(checkResult));
|
||||
NazaraErrorFmt("blit draw FBO is incomplete: {0}", TranslateOpenGLError(checkResult));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GLenum checkResult = m_blitFramebuffers->readFBO.Check(); checkResult != GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
NazaraError("Blit read FBO is incomplete: {0}", TranslateOpenGLError(checkResult));
|
||||
NazaraErrorFmt("blit read FBO is incomplete: {0}", TranslateOpenGLError(checkResult));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -628,14 +628,14 @@ namespace Nz::GL
|
||||
|
||||
unsigned int maxTextureUnits = GetInteger<unsigned int>(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
||||
if (maxTextureUnits < 32) //< OpenGL ES 3.0 requires at least 32 textures units
|
||||
NazaraWarning("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS is " + std::to_string(maxTextureUnits) + ", expected >= 32");
|
||||
NazaraWarningFmt("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS is {0}, expected >= 32", maxTextureUnits);
|
||||
|
||||
assert(maxTextureUnits > 0);
|
||||
m_state.textureUnits.resize(maxTextureUnits);
|
||||
|
||||
unsigned int maxUniformBufferUnits = GetInteger<unsigned int>(GL_MAX_UNIFORM_BUFFER_BINDINGS);
|
||||
if (maxUniformBufferUnits < 24) //< OpenGL ES 3.0 requires at least 24 uniform buffers units
|
||||
NazaraWarning("GL_MAX_UNIFORM_BUFFER_BINDINGS is " + std::to_string(maxUniformBufferUnits) + ", expected >= 24");
|
||||
NazaraWarningFmt("GL_MAX_UNIFORM_BUFFER_BINDINGS is {0}, expected >= 24", maxUniformBufferUnits);
|
||||
|
||||
assert(maxUniformBufferUnits > 0);
|
||||
m_state.uboUnits.resize(maxUniformBufferUnits);
|
||||
@@ -651,7 +651,7 @@ namespace Nz::GL
|
||||
{
|
||||
unsigned int maxStorageBufferUnits = GetInteger<unsigned int>(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS);
|
||||
if (maxStorageBufferUnits < 8) //< OpenGL ES 3.1 requires at least 8 storage buffers units
|
||||
NazaraWarning("GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS is " + std::to_string(maxUniformBufferUnits) + ", expected >= 8");
|
||||
NazaraWarningFmt("GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS is {0}, expected >= 8", maxUniformBufferUnits);
|
||||
|
||||
assert(maxStorageBufferUnits > 0);
|
||||
m_state.storageUnits.resize(maxStorageBufferUnits);
|
||||
@@ -710,7 +710,7 @@ namespace Nz::GL
|
||||
{
|
||||
hasAnyError = true;
|
||||
|
||||
NazaraError("OpenGL error: {0}", TranslateOpenGLError(lastError));
|
||||
NazaraErrorFmt("OpenGL error: {0}", TranslateOpenGLError(lastError));
|
||||
}
|
||||
|
||||
m_didCollectErrors = true;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Nz::GL
|
||||
|
||||
bool EGLContextBase::Create(const ContextParams& /*params*/, WindowHandle /*window*/, const EGLContextBase* /*shareContext*/)
|
||||
{
|
||||
NazaraError("Unexpected context creation call");
|
||||
NazaraError("unexpected context creation call");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Nz::GL
|
||||
EGLint numConfig = 0;
|
||||
if (m_loader.eglChooseConfig(m_display, configAttributes, configs, EGLint(maxConfigCount), &numConfig) != GL_TRUE)
|
||||
{
|
||||
NazaraError("failed to retrieve compatible EGL configurations: {0}", EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
NazaraErrorFmt("failed to retrieve compatible EGL configurations: {0}", EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Nz::GL
|
||||
|
||||
if (!m_handle)
|
||||
{
|
||||
NazaraError("failed to create EGL context: {0}", EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
NazaraErrorFmt("failed to create EGL context: {0}", EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Nz::GL
|
||||
HWNDHandle window(::CreateWindowA("STATIC", nullptr, WS_DISABLED | WS_POPUP, 0, 0, 1, 1, nullptr, nullptr, GetModuleHandle(nullptr), nullptr));
|
||||
if (!window)
|
||||
{
|
||||
NazaraError("failed to create dummy window: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to create dummy window: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Nz::GL
|
||||
m_deviceContext = ::GetDC(window.get());
|
||||
if (!m_deviceContext)
|
||||
{
|
||||
NazaraError("failed to retrieve dummy window device context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to retrieve dummy window device context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Nz::GL
|
||||
m_deviceContext = ::GetDC(static_cast<HWND>(window.windows.window));
|
||||
if (!m_deviceContext)
|
||||
{
|
||||
NazaraError("failed to retrieve window device context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to retrieve window device context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Nz::GL
|
||||
|
||||
if (!m_handle)
|
||||
{
|
||||
NazaraError("failed to create WGL context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to create WGL context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,7 @@ namespace Nz::GL
|
||||
m_handle = m_loader.wglCreateContext(m_deviceContext);
|
||||
if (!m_handle)
|
||||
{
|
||||
NazaraError("failed to create WGL context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to create WGL context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace Nz::GL
|
||||
{
|
||||
if (!m_loader.wglShareLists(shareContext->m_handle, m_handle))
|
||||
{
|
||||
NazaraError("failed to share context objects: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to share context objects: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ namespace Nz::GL
|
||||
bool succeeded = m_loader.wglMakeCurrent(m_deviceContext, m_handle);
|
||||
if (!succeeded)
|
||||
{
|
||||
NazaraError("failed to activate context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to activate context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -389,14 +389,14 @@ namespace Nz::GL
|
||||
pixelFormat = m_loader.ChoosePixelFormat(m_deviceContext, &descriptor);
|
||||
if (pixelFormat == 0)
|
||||
{
|
||||
NazaraError("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_loader.SetPixelFormat(m_deviceContext, pixelFormat, &descriptor))
|
||||
{
|
||||
NazaraError("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Nz::GL
|
||||
|
||||
if (m_handle <= 0)
|
||||
{
|
||||
NazaraError("failed to create Web context: {0}", WebLoader::TranslateError(static_cast<EMSCRIPTEN_RESULT>(m_handle)));
|
||||
NazaraErrorFmt("failed to create Web context: {0}", WebLoader::TranslateError(static_cast<EMSCRIPTEN_RESULT>(m_handle)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Nz::GL
|
||||
HWNDHandle window(::CreateWindowA("STATIC", nullptr, WS_DISABLED | WS_POPUP, 0, 0, 1, 1, nullptr, nullptr, GetModuleHandle(nullptr), nullptr));
|
||||
if (!window)
|
||||
{
|
||||
NazaraError("failed to create dummy window: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to create dummy window: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Nz::GL
|
||||
/*HDC deviceContext = ::GetDC(windowHandle);
|
||||
if (!deviceContext)
|
||||
{
|
||||
NazaraError("failed to retrieve window device context: {0}", Error::GetLastSystemError());
|
||||
NazaraErrorFmt("failed to retrieve window device context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user