diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-11-22 20:14:16 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-11-22 20:14:46 +0300 |
commit | 8623d75b468ff1a495a326cf74ca6d61f1ee4ce7 (patch) | |
tree | c958bc2560ed8de2292b04397e36f86f90ae02c1 | |
parent | 4310a76b6043f6468eb9620452e77779a6320569 (diff) |
Add check for OpenGL version 2.1 on linux.
Unfortunately there's no easy way to show a messagebox here, so just
print a warning on fstderr and exit. If we don't call exit() here we get
crashes on other blender systems (python, opensubdiv) and it can get
tricky to track the initialization state here, so just using exit()
should do the trick for now.
-rw-r--r-- | intern/ghost/intern/GHOST_ContextGLX.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp index 0ee8da15dea..8e46c9513aa 100644 --- a/intern/ghost/intern/GHOST_ContextGLX.cpp +++ b/intern/ghost/intern/GHOST_ContextGLX.cpp @@ -94,7 +94,7 @@ GHOST_ContextGLX::~GHOST_ContextGLX() if (m_context != None) { if (m_window != 0 && m_context == ::glXGetCurrentContext()) - ::glXMakeCurrent(m_display, m_window, NULL); + ::glXMakeCurrent(m_display, None, NULL); if (m_context != s_sharedContext || s_sharedCount == 1) { assert(s_sharedCount > 0); @@ -308,6 +308,8 @@ const bool GLXEW_ARB_create_context_robustness = GHOST_TSuccess success; if (m_context != NULL) { + const unsigned char *version; + if (!s_sharedContext) s_sharedContext = m_context; @@ -325,7 +327,16 @@ const bool GLXEW_ARB_create_context_robustness = /* re initialize to get the extensions properly */ initContextGLXEW(); - success = GHOST_kSuccess; + version = glGetString(GL_VERSION); + + if (version[0] < '2' || ((version[0] == '2') && (version[2] < '1'))) { + fprintf(stderr, "Error! Blender requires OpenGL 2.1 to run.\n"); + fflush(stderr); + /* ugly, but we get crashes unless a whole bunch of systems are patched. */ + exit(0); + } + else + success = GHOST_kSuccess; } else { /* freeing well clean up the context initialized above */ |