From f4f58551684ed829d4e2ae07bc1b2706ab846a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Sun, 25 Sep 2016 13:06:12 +0200 Subject: [PATCH] Don't crach when OpenGL version is unsupported (cherry picked from commit ca3b8deb7860eb54c2b5ef44eb686799a688febc) --- drivers/gles2/rasterizer_gles2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 212d115700d..37155619da2 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -36,6 +36,7 @@ #include "servers/visual/particle_system_sw.h" #include "gl_context/context_gl.h" #include +#include #ifdef GLEW_ENABLED #define _GL_HALF_FLOAT_OES 0x140B @@ -10826,11 +10827,11 @@ void RasterizerGLES2::init() { // Check for GL 2.1 compatibility, if not bail out if (!(glewIsSupported("GL_VERSION_2_1") && framebuffer_object_is_supported)) { ERR_PRINT("Your system's graphic drivers seem not to support OpenGL 2.1 / GLES 2.0, sorry :(\n" - "Try a drivers update, buy a new GPU or try software rendering on Linux; Godot will now crash with a segmentation fault."); + "Try a drivers update, buy a new GPU or try software rendering on Linux; Godot is now going to terminate."); OS::get_singleton()->alert("Your system's graphic drivers seem not to support OpenGL 2.1 / GLES 2.0, sorry :(\n" "Godot Engine will self-destruct as soon as you acknowledge this error message.", "Fatal error: Insufficient OpenGL / GLES drivers"); - // TODO: If it's even possible, we should stop the execution without segfault and memory leaks :) + exit(1); } #endif