From 1ac0f136629ce4046a5f6529cf3d1e51e96df408 Mon Sep 17 00:00:00 2001 From: hachem Date: Wed, 13 Aug 2025 19:25:30 +0200 Subject: feat: logging system --- src/core/window.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/core/window.cpp') diff --git a/src/core/window.cpp b/src/core/window.cpp index 9605f8c..a32dddb 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_glfw_initialized) { int success = glfwInit(); if (!success) { - std::cout << "Could not initialize GLFW!" << std::endl; + DONUT_ERROR("Could not initialize GLFW!"); return; } s_glfw_initialized = 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_glfw_window_count--; @@ -67,6 +73,7 @@ namespace Donut { glfwTerminate(); s_glfw_initialized = false; + DONUT_INFO("GLFW terminated (no more windows)"); } } @@ -97,7 +104,7 @@ namespace Donut void Window::glfw_error_callback(int error, const char* description) { - std::cout << "GLFW Error (" << error << "): " << description << std::endl; + DONUT_ERROR("GLFW Error (", error, "): ", description); } void Window::glfw_window_close_callback(GLFWwindow* window) -- cgit v1.3