diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-26 18:48:55 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 18:48:55 -0300 |
commit | 548a69aca7d843654ccc554da436bd03f2d59a7b (patch) | |
tree | 090dea8e5ca349fefdd1137b0a2b212d246b222a | |
parent | 80e8904784796e3592c667ef8cb4acbda6ab9821 (diff) | |
parent | fd659e869b86bc72d1e22ee601ba46d145b8dbaa (diff) |
Merge pull request #5909 from akien-mga/pr-gles2-error-before-crash
GLES2: Check for GPU capabilities to display an error
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 11 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 4cd97a7f6a..ba93a26a2d 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -10788,8 +10788,17 @@ void RasterizerGLES2::init() { if (OS::get_singleton()->is_stdout_verbose()) { print_line(String("GLES2: Using GLEW ") + (const char*) glewGetString(GLEW_VERSION)); } -#endif + // Check for GL 2.1 compatibility, if not bail out + if (!glewIsSupported("GL_VERSION_2_1")) { + 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."); + 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 :) + } +#endif diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a3858fe641..571277f91e 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1343,7 +1343,7 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { void OS_Windows::alert(const String& p_alert,const String& p_title) { if (!is_no_window_mode_enabled()) - MessageBoxW(NULL,p_alert.c_str(),p_title.c_str(),MB_OK|MB_ICONEXCLAMATION); + MessageBoxW(NULL, p_alert.c_str(), p_title.c_str(), MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); else print_line("ALERT: "+p_alert); } |