diff options
| author | hachem <im@hachem.wtf> | 2025-08-13 19:25:30 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-13 19:25:30 +0200 |
| commit | 616fb227257029c4f7f5c00120afd24c56528517 (patch) | |
| tree | 00753440951feb7696a09b4cd9963929e36b900f /src/Core/Window.cpp | |
| parent | 8a0b2a59c9809d5fc8e6a30c2abc4d5af21aa39e (diff) | |
[add]: Logging system
Diffstat (limited to 'src/Core/Window.cpp')
| -rw-r--r-- | src/Core/Window.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Core/Window.cpp b/src/Core/Window.cpp index 853abb0..832235a 100644 --- a/src/Core/Window.cpp +++ b/src/Core/Window.cpp @@ -21,25 +21,30 @@ namespace Donut void Window::Init() { + DONUT_INFO("Initializing window: ", m_Title, " (", m_Width, "x", m_Height, ")"); + if (!s_GLFWInitialized) { int success = glfwInit(); if (!success) { - std::cout << "Could not initialize GLFW!" << std::endl; + DONUT_ERROR("Could not initialize GLFW!"); return; } s_GLFWInitialized = true; + DONUT_INFO("GLFW initialized successfully"); } m_Window = glfwCreateWindow(m_Width, m_Height, m_Title.c_str(), nullptr, nullptr); if (!m_Window) { - std::cout << "Could not create GLFW window!" << std::endl; + DONUT_ERROR("Could not create GLFW window!"); glfwTerminate(); return; } + + DONUT_INFO("GLFW window created successfully"); glfwMakeContextCurrent(m_Window); glfwSetWindowUserPointer(m_Window, this); @@ -60,6 +65,7 @@ namespace Donut void Window::Shutdown() { + DONUT_INFO("Shutting down window: ", m_Title); glfwDestroyWindow(m_Window); s_GLFWWindowCount--; @@ -67,6 +73,7 @@ namespace Donut { glfwTerminate(); s_GLFWInitialized = false; + DONUT_INFO("GLFW terminated (no more windows)"); } } @@ -97,7 +104,7 @@ namespace Donut void Window::GLFWErrorCallback(int error, const char* description) { - std::cout << "GLFW Error (" << error << "): " << description << std::endl; + DONUT_ERROR("GLFW Error (", error, "): ", description); } void Window::GLFWWindowCloseCallback(GLFWwindow* window) |
