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 | 1ac0f136629ce4046a5f6529cf3d1e51e96df408 (patch) | |
| tree | ea42cf71c3a7760d1454f90dca36147d353a3581 /src/core/window.cpp | |
| parent | 23086a5d33acc66414f1169bf22abe78b3383f94 (diff) | |
feat: 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 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) |
