|
@@ -18,6 +18,10 @@ BaseWindow::BaseWindow(int width, int height, const char *title, Color clear_col
|
|
|
|
|
|
BaseWindow::~BaseWindow()
|
|
|
{
|
|
|
+ ImGui_ImplOpenGL3_Shutdown();
|
|
|
+ ImGui_ImplGlfw_Shutdown();
|
|
|
+ ImGui::DestroyContext();
|
|
|
+ glfwDestroyWindow(m_window);
|
|
|
glfwTerminate();
|
|
|
}
|
|
|
|
|
@@ -36,7 +40,7 @@ int BaseWindow::run()
|
|
|
std::cout << "could not intialize GLFW Window"
|
|
|
<< "\n";
|
|
|
glfwTerminate();
|
|
|
- return -1;
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
glfwMakeContextCurrent(m_window);
|
|
@@ -44,7 +48,7 @@ int BaseWindow::run()
|
|
|
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
|
|
|
{
|
|
|
std::cout << "Failed to initialize GLAD" << std::endl;
|
|
|
- return -1;
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
glfwSetFramebufferSizeCallback(m_window, window_resize_callback);
|
|
@@ -139,10 +143,6 @@ int BaseWindow::run()
|
|
|
}
|
|
|
|
|
|
// Unload and destroy
|
|
|
- ImGui_ImplOpenGL3_Shutdown();
|
|
|
- ImGui_ImplGlfw_Shutdown();
|
|
|
- ImGui::DestroyContext();
|
|
|
- glfwDestroyWindow(m_window);
|
|
|
- glfwTerminate();
|
|
|
+
|
|
|
return 0;
|
|
|
}
|