Rework logger

This commit is contained in:
Antoine Pilote
2023-07-21 22:25:17 -04:00
parent 46a531fd7d
commit e4119c0d15
26 changed files with 127 additions and 97 deletions

View File

@@ -53,30 +53,33 @@ namespace Nuake
{
if (!glfwInit())
{
Logger::Log("glfw initialization failed.", CRITICAL);
Logger::Log("GLFW initialization failed", "window", CRITICAL);
return -1;
}
m_Window = glfwCreateWindow(m_Width, m_Height, m_Title.c_str(), NULL, NULL);
if (!m_Window)
{
Logger::Log("Window creation failed.", CRITICAL);
Logger::Log("Window creation failed", "window", CRITICAL);
return -1;
}
SetWindowIcon("resources/Images/nuake-logo.png");
glfwMakeContextCurrent(m_Window);
SetVSync(0);
//SetVSync(true)
Logger::Log((char*)glGetString(GL_VERSION));
Logger::Log("Driver detected " + std::string(((char*)glGetString(GL_VERSION))), "renderer");
if (glewInit() != GLEW_OK)
{
Logger::Log("GLEW initialization failed!", CRITICAL);
Logger::Log("GLEW initialization failed!", "window", CRITICAL);
return -1;
}
if (glfwRawMouseMotionSupported())
glfwSetInputMode(m_Window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
// TODO: Move this to renderer init. The window shouldnt have to do gl calls.
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);