From 0f6bce8709aa58c02ea83b013ed60e778c515ff6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 7 Dec 2021 22:39:50 -0500 Subject: [PATCH] Replace exit() with Exceptions. --- src/window/Window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/window/Window.cpp b/src/window/Window.cpp index 7336bd68..08ed9fe5 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -270,7 +270,7 @@ Window::Window() { win = glfwCreateWindow(1024, 768, "", NULL, NULL); if (!win) { osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, "Could not open GLFW window. Does your graphics card support OpenGL 2.0 or greater? If so, make sure you have the latest graphics drivers installed."); - exit(1); + throw Exception("Could not create Window"); } float contentScale; @@ -319,7 +319,7 @@ Window::Window() { err = glewInit(); if (err != GLEW_OK) { osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, "Could not initialize GLEW. Does your graphics card support OpenGL 2.0 or greater? If so, make sure you have the latest graphics drivers installed."); - exit(1); + throw Exception("Could not initialize GLEW"); } const GLubyte* vendor = glGetString(GL_VENDOR); @@ -343,7 +343,7 @@ Window::Window() { #endif if (!vg) { osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, "Could not initialize NanoVG. Does your graphics card support OpenGL 2.0 or greater? If so, make sure you have the latest graphics drivers installed."); - exit(1); + throw Exception("Could not initialize NanoVG"); } // Load default Blendish font @@ -766,7 +766,7 @@ void init() { err = glfwInit(); if (err != GLFW_TRUE) { osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, "Could not initialize GLFW."); - exit(1); + throw Exception("Could not initialize GLFW"); } }