summaryrefslogtreecommitdiff
path: root/Source/Core/Common/GL/GLInterface/WGL.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-10-23 14:41:30 -0400
committerLioncash <mathew1800@gmail.com>2020-10-23 14:58:03 -0400
commit4e8df93f4179a684b507d9c712b7e8121fc83119 (patch)
tree2d4257714fcad53325789389e22ff35087a7c28c /Source/Core/Common/GL/GLInterface/WGL.cpp
parent4f5c8bb42ae617a5c2823277a4a9ced1df2be445 (diff)
Common: Migrate logging to fmt
Continues the migration of our code over to the fmt logger.
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/WGL.cpp')
-rw-r--r--Source/Core/Common/GL/GLInterface/WGL.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/Source/Core/Common/GL/GLInterface/WGL.cpp b/Source/Core/Common/GL/GLInterface/WGL.cpp
index 034d05a415..cf30dcf5e3 100644
--- a/Source/Core/Common/GL/GLInterface/WGL.cpp
+++ b/Source/Core/Common/GL/GLInterface/WGL.cpp
@@ -162,10 +162,10 @@ GLContextWGL::~GLContextWGL()
if (m_rc)
{
if (wglGetCurrentContext() == m_rc && !wglMakeCurrent(m_dc, nullptr))
- NOTICE_LOG(VIDEO, "Could not release drawing context.");
+ NOTICE_LOG_FMT(VIDEO, "Could not release drawing context.");
if (!wglDeleteContext(m_rc))
- ERROR_LOG(VIDEO, "Attempt to release rendering context failed.");
+ ERROR_LOG_FMT(VIDEO, "Attempt to release rendering context failed.");
m_rc = nullptr;
}
@@ -183,7 +183,7 @@ GLContextWGL::~GLContextWGL()
else
{
if (!ReleaseDC(m_window_handle, m_dc))
- ERROR_LOG(VIDEO, "Attempt to release device context failed.");
+ ERROR_LOG_FMT(VIDEO, "Attempt to release device context failed.");
m_dc = nullptr;
}
@@ -198,9 +198,14 @@ bool GLContextWGL::IsHeadless() const
void GLContextWGL::SwapInterval(int interval)
{
if (wglSwapIntervalEXT)
+ {
wglSwapIntervalEXT(interval);
+ }
else
- ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate).");
+ {
+ ERROR_LOG_FMT(VIDEO,
+ "No support for SwapInterval (framerate clamped to monitor refresh rate).");
+ }
}
void GLContextWGL::Swap()
{
@@ -331,7 +336,7 @@ bool GLContextWGL::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor
}
else
{
- WARN_LOG(VIDEO, "Failed to create a core OpenGL context. Using fallback context.");
+ WARN_LOG_FMT(VIDEO, "Failed to create a core OpenGL context. Using fallback context.");
}
}
@@ -367,7 +372,7 @@ HGLRC GLContextWGL::CreateCoreContext(HDC dc, HGLRC share_context)
{
if (!wglCreateContextAttribsARB)
{
- WARN_LOG(VIDEO, "Missing WGL_ARB_create_context extension");
+ WARN_LOG_FMT(VIDEO, "Missing WGL_ARB_create_context extension");
return nullptr;
}
@@ -400,18 +405,18 @@ HGLRC GLContextWGL::CreateCoreContext(HDC dc, HGLRC share_context)
{
if (!wglShareLists(share_context, core_context))
{
- ERROR_LOG(VIDEO, "wglShareLists failed");
+ ERROR_LOG_FMT(VIDEO, "wglShareLists failed");
wglDeleteContext(core_context);
return nullptr;
}
}
- INFO_LOG(VIDEO, "WGL: Created a GL %d.%d core context", version.first, version.second);
+ INFO_LOG_FMT(VIDEO, "WGL: Created a GL {}.{} core context", version.first, version.second);
return core_context;
}
}
- WARN_LOG(VIDEO, "Unable to create a core OpenGL context of an acceptable version");
+ WARN_LOG_FMT(VIDEO, "Unable to create a core OpenGL context of an acceptable version");
return nullptr;
}
@@ -421,7 +426,7 @@ bool GLContextWGL::CreatePBuffer(HDC onscreen_dc, int width, int height, HANDLE*
if (!wglChoosePixelFormatARB || !wglCreatePbufferARB || !wglGetPbufferDCARB ||
!wglReleasePbufferDCARB || !wglDestroyPbufferARB)
{
- ERROR_LOG(VIDEO, "Missing WGL_ARB_pbuffer extension");
+ ERROR_LOG_FMT(VIDEO, "Missing WGL_ARB_pbuffer extension");
return false;
}
@@ -448,7 +453,7 @@ bool GLContextWGL::CreatePBuffer(HDC onscreen_dc, int width, int height, HANDLE*
if (!wglChoosePixelFormatARB(onscreen_dc, pf_iattribs.data(), pf_fattribs.data(), 1,
&pixel_format, &num_pixel_formats))
{
- ERROR_LOG(VIDEO, "Failed to obtain a compatible pbuffer pixel format");
+ ERROR_LOG_FMT(VIDEO, "Failed to obtain a compatible pbuffer pixel format");
return false;
}
@@ -458,14 +463,14 @@ bool GLContextWGL::CreatePBuffer(HDC onscreen_dc, int width, int height, HANDLE*
wglCreatePbufferARB(onscreen_dc, pixel_format, width, height, pb_attribs.data());
if (!pbuffer)
{
- ERROR_LOG(VIDEO, "Failed to create pbuffer");
+ ERROR_LOG_FMT(VIDEO, "Failed to create pbuffer");
return false;
}
HDC dc = wglGetPbufferDCARB(pbuffer);
if (!dc)
{
- ERROR_LOG(VIDEO, "Failed to get drawing context from pbuffer");
+ ERROR_LOG_FMT(VIDEO, "Failed to get drawing context from pbuffer");
wglDestroyPbufferARB(pbuffer);
return false;
}