1
0
Fork 0

include/Spectre/System/Log.h: implement a static "Log" class instead of just a function.

This commit is contained in:
Henrik Hautakoski 2019-11-10 14:56:56 +01:00
parent e10daeaaa6
commit 3b27db9435
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
8 changed files with 101 additions and 31 deletions

View file

@ -18,11 +18,11 @@ static void ensureExtensionsLoaded(HDC dc)
init = true;
if (!gladLoadWGL(dc)) {
log("Win32: Could not load WGL extensions\n");
Log::error("Win32: Could not load WGL extensions");
}
if (!gladLoadGL()) {
log("Win32: Could not load OpenGL extensions\n");
Log::error("Win32: Could not load OpenGL extensions\n");
}
}
}
@ -48,7 +48,7 @@ bool Win32GLContext::create(const PlatformDisplay* display)
// Should have a valid handle here. trigger error.
if (!m_wnd) {
log("Win32 - Could not create GL context: Invalid display handle\n");
Log::warn("Win32 - Could not create GL context: Invalid display handle\n");
return false;
}
@ -61,7 +61,7 @@ bool Win32GLContext::create(const PlatformDisplay* display)
// Make sure we release all handles.
destroy();
log("Win32 - Could not create GL context: %s", Win32GetMessage(GetLastError()));
Log::warn("Win32 - Could not create GL context: %s", Win32GetMessage(GetLastError()));
return false;
}
return true;