Allow error message to be formatted
This commit is contained in:
committed by
Jérôme Leclercq
parent
25957c4b7f
commit
a741672a51
@@ -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: " + TranslateOpenGLError(checkResult));
|
||||
NazaraError("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: " + TranslateOpenGLError(checkResult));
|
||||
NazaraError("Blit read FBO is incomplete: {0}", TranslateOpenGLError(checkResult));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -707,7 +707,7 @@ namespace Nz::GL
|
||||
{
|
||||
hasAnyError = true;
|
||||
|
||||
NazaraError("OpenGL error: " + TranslateOpenGLError(lastError));
|
||||
NazaraError("OpenGL error: {0}", TranslateOpenGLError(lastError));
|
||||
}
|
||||
|
||||
m_didCollectErrors = true;
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Nz::GL
|
||||
EGLint numConfig = 0;
|
||||
if (m_loader.eglChooseConfig(m_display, configAttributes, configs, EGLint(maxConfigCount), &numConfig) != GL_TRUE)
|
||||
{
|
||||
NazaraError(std::string("failed to retrieve compatible EGL configurations: ") + EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
NazaraError("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(std::string("failed to create EGL context: ") + EGLLoader::TranslateError(m_loader.eglGetError()));
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_loader.SetPixelFormat(m_deviceContext, pixelFormat, &descriptor))
|
||||
{
|
||||
NazaraError("Failed to choose pixel format: " + Error::GetLastSystemError());
|
||||
NazaraError("failed to choose pixel format: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,13 +126,13 @@ namespace Nz::GL
|
||||
}
|
||||
else
|
||||
{
|
||||
NazaraError(std::string("failed to create WebGL context: OpenGL is not supported"));
|
||||
NazaraError("failed to create WebGL context: OpenGL is not supported");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_handle <= 0)
|
||||
{
|
||||
NazaraError(std::string("failed to create Web context: ") + WebLoader::TranslateError(static_cast<EMSCRIPTEN_RESULT>(m_handle)));
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("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: " + Error::GetLastSystemError());
|
||||
NazaraError("failed to retrieve window device context: {0}", Error::GetLastSystemError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user