hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/core/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/window.cpp')
-rw-r--r--src/core/window.cpp13
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)