summarylogtreecommitdiffstats
path: root/wxGLContext_ctor_x11Direct20160316.patch
blob: 83f6283c383b6665b6dfd6811786632e9db41c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git src/unix/glx11.cpp src/unix/glx11.cpp
index 6534601..90bfc93 100644
--- src/unix/glx11.cpp
+++ src/unix/glx11.cpp
@@ -486,18 +486,17 @@ wxGLContext::wxGLContext(wxGLCanvas *win,
 
     // We need to create a temporary context to get the
     // glXCreateContextAttribsARB function
-    GLXContext tempContext = glXCreateContext(dpy, vi, NULL,
-                                              win->GetGLCTXAttrs().x11Direct );
+    GLXContext tempContext = glXCreateContext(dpy, vi, NULL, x11Direct);
     wxCHECK_RET(tempContext, "glXCreateContext failed" );
 
-    PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB
+    PFNGLXCREATECONTEXTATTRIBSARBPROC wx_glXCreateContextAttribsARB
         = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
         glXGetProcAddress((GLubyte *)"glXCreateContextAttribsARB");
 
     glXDestroyContext( dpy, tempContext );
 
     // The preferred way is using glXCreateContextAttribsARB, even for old context
-    if ( !glXCreateContextAttribsARB && needsARB ) // OpenGL 3 context creation
+    if ( !wx_glXCreateContextAttribsARB && needsARB ) // OpenGL 3 context creation
     {
         wxLogMessage(_("OpenGL 3.0 or later is not supported by the OpenGL driver."));
         return;
@@ -508,12 +507,12 @@ wxGLContext::wxGLContext(wxGLCanvas *win,
     g_ctxErrorOccurred = false;
     int (*oldHandler)(Display*, XErrorEvent*) = XSetErrorHandler(&CTXErrorHandler);
 
-    if ( glXCreateContextAttribsARB )
+    if ( wx_glXCreateContextAttribsARB )
     {
         GLXFBConfig *fbc = win->GetGLXFBConfig();
         wxCHECK_RET( fbc, "Invalid GLXFBConfig for OpenGL" );
 
-        m_glContext = glXCreateContextAttribsARB( dpy, fbc[0],
+        m_glContext = wx_glXCreateContextAttribsARB( dpy, fbc[0],
                                 other ? other->m_glContext : None,
                                 x11Direct, contextAttribs );
     }