Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_ContextGLX.cpp')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp44
1 files changed, 10 insertions, 34 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 9ac61db4041..0a9dc900aed 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -48,10 +48,6 @@ static GLuint _glewStrLen(const GLubyte *s);
static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end);
#endif
-#ifdef WITH_GLEW_MX
-GLXEWContext *glxewContext = NULL;
-#endif
-
GLXContext GHOST_ContextGLX::s_sharedContext = None;
int GHOST_ContextGLX::s_sharedCount = 0;
@@ -79,10 +75,6 @@ GHOST_ContextGLX::GHOST_ContextGLX(
m_contextFlags(contextFlags),
m_contextResetNotificationStrategy(contextResetNotificationStrategy),
m_context(None)
-#ifdef WITH_GLEW_MX
- ,
- m_glxewContext(NULL)
-#endif
{
assert(m_window != 0);
assert(m_display != NULL);
@@ -92,8 +84,6 @@ GHOST_ContextGLX::GHOST_ContextGLX(
GHOST_ContextGLX::~GHOST_ContextGLX()
{
if (m_display != NULL) {
- activateGLXEW();
-
if (m_context != None) {
if (m_window != 0 && m_context == ::glXGetCurrentContext())
::glXMakeCurrent(m_display, None, NULL);
@@ -109,11 +99,6 @@ GHOST_ContextGLX::~GHOST_ContextGLX()
::glXDestroyContext(m_display, m_context);
}
}
-
-#ifdef WITH_GLEW_MX
- if (m_glxewContext)
- delete m_glxewContext;
-#endif
}
}
@@ -129,9 +114,6 @@ GHOST_TSuccess GHOST_ContextGLX::swapBuffers()
GHOST_TSuccess GHOST_ContextGLX::activateDrawingContext()
{
if (m_display) {
- activateGLXEW();
- activateGLEW();
-
return ::glXMakeCurrent(m_display, m_window, m_context) ? GHOST_kSuccess : GHOST_kFailure;
}
else {
@@ -141,15 +123,6 @@ GHOST_TSuccess GHOST_ContextGLX::activateDrawingContext()
void GHOST_ContextGLX::initContextGLXEW()
{
-#ifdef WITH_GLEW_MX
- glxewContext = new GLXEWContext;
- memset(glxewContext, 0, sizeof(GLXEWContext));
-
- if (m_glxewContext)
- delete m_glxewContext;
- m_glxewContext = glxewContext;
-#endif
-
initContextGLEW();
}
@@ -255,9 +228,6 @@ const bool GLXEW_ARB_create_context_robustness =
if (m_contextMajorVersion != 0) {
attribs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
attribs[i++] = m_contextMajorVersion;
- }
-
- if (m_contextMinorVersion != 0) {
attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
attribs[i++] = m_contextMinorVersion;
}
@@ -300,8 +270,8 @@ const bool GLXEW_ARB_create_context_robustness =
}
}
else {
- /* Create legacy context */
- m_context = glXCreateContext(m_display, m_visualInfo, s_sharedContext, True);
+ /* Don't create legacy context */
+ fprintf(stderr, "Warning! GLX_ARB_create_context not available.\n");
}
GHOST_TSuccess success;
@@ -328,8 +298,14 @@ const bool GLXEW_ARB_create_context_robustness =
version = glGetString(GL_VERSION);
- if (!version || version[0] < '2' || ((version[0] == '2') && (version[2] < '1'))) {
- fprintf(stderr, "Error! Blender requires OpenGL 2.1 to run. Try updating your drivers.\n");
+#if 0 // enable this when Blender switches to 3.3 core profile
+ if (!version || version[0] < '3' || ((version[0] == '3') && (version[2] < '3'))) {
+ fprintf(stderr, "Error! Blender requires OpenGL 3.3 to run. Try updating your drivers.\n");
+#else
+ // with Mesa, the closest thing to 3.3 compatibility profile is 3.0
+ if (!version || version[0] < '3') {
+ fprintf(stderr, "Error! Blender requires OpenGL 3.0 (soon 3.3) to run. Try updating your drivers.\n");
+#endif
fflush(stderr);
/* ugly, but we get crashes unless a whole bunch of systems are patched. */
exit(0);