X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33980f0da63a5c78e88df40d39b010fbe33d867a..3ba18664fc65e3494695bbd57250bcee36625c91:/src/x11/glcanvas.cpp?ds=sidebyside diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp index 1354afb710..3736c7e91e 100644 --- a/src/x11/glcanvas.cpp +++ b/src/x11/glcanvas.cpp @@ -18,9 +18,12 @@ #if wxUSE_GLCANVAS +// #error Sorry, wxGLCanvas does not work yet with wxX11 + #include "wx/glcanvas.h" #include "wx/utils.h" #include "wx/app.h" +#include "wx/log.h" #ifdef __VMS # pragma message disable nosimpint @@ -108,7 +111,7 @@ void wxGLContext::SwapBuffers() if (m_glContext) { Display* display = (Display*) wxGetDisplay(); - glXSwapBuffers(display, (Window) m_window->GetClientWindow()); + glXSwapBuffers(display, (Window) m_window->GetClientAreaWindow()); } } @@ -117,7 +120,7 @@ void wxGLContext::SetCurrent() if (m_glContext) { Display* display = (Display*) wxGetDisplay(); - glXMakeCurrent(display, (Window) m_window->GetClientWindow(), + glXMakeCurrent(display, (Window) m_window->GetClientAreaWindow(), m_glContext );; } } @@ -237,8 +240,8 @@ bool wxGLCanvas::Create( wxWindow *parent, // Check for the presence of the GLX extension if(!glXQueryExtension(display, NULL, NULL)) { - wxDebugMsg("wxGLCanvas: GLX extension is missing\n"); - return false; + wxLogDebug("wxGLCanvas: GLX extension is missing\n"); + return FALSE; } if(attribList) { @@ -286,7 +289,7 @@ bool wxGLCanvas::Create( wxWindow *parent, attribList = (int*) data; // Get an appropriate visual vi = glXChooseVisual(display, DefaultScreen(display), attribList); - if(!vi) return false; + if(!vi) return FALSE; // Here we should make sure that vi is the same visual as the // one used by the xwindow drawable in wxCanvas. However, @@ -294,12 +297,12 @@ bool wxGLCanvas::Create( wxWindow *parent, } else { // By default, we use the visual of xwindow // NI: is this really senseful ? opengl in e.g. color index mode ? - XGetWindowAttributes(display, (Window) GetClientWindow(), &xwa); + XGetWindowAttributes(display, (Window) GetClientAreaWindow(), &xwa); vi_templ.visualid = XVisualIDFromVisual(xwa.visual); vi = XGetVisualInfo(display, VisualIDMask, &vi_templ, &n); - if(!vi) return false; + if(!vi) return FALSE; glXGetConfig(display, vi, GLX_USE_GL, &val); - if(!val) return false; + if(!val) return FALSE; // Basically, this is it. It should be possible to use vi // in glXCreateContext() below. But this fails with Mesa. // I notified the Mesa author about it; there may be a fix. @@ -326,7 +329,7 @@ bool wxGLCanvas::Create( wxWindow *parent, a_list[n] = None; // XFree(vi); vi = glXChooseVisual(display, DefaultScreen(display), a_list); - if(!vi) return false; + if(!vi) return FALSE; #endif /* OLD_MESA */ } @@ -347,7 +350,7 @@ bool wxGLCanvas::Create( wxWindow *parent, #endif SetCurrent(); - return true; + return TRUE; } wxGLCanvas::~wxGLCanvas(void) @@ -366,7 +369,7 @@ void wxGLCanvas::SwapBuffers() if( m_glContext ) m_glContext->SwapBuffers(); // Display* display = (Display*) GetXDisplay(); - // if(glx_cx) glXSwapBuffers(display, (Window) GetClientWindow()); + // if(glx_cx) glXSwapBuffers(display, (Window) GetClientAreaWindow()); } void wxGLCanvas::SetCurrent() @@ -374,7 +377,7 @@ void wxGLCanvas::SetCurrent() if( m_glContext ) m_glContext->SetCurrent(); // Display* display = (Display*) GetXDisplay(); - // if(glx_cx) glXMakeCurrent(display, (Window) GetClientWindow(), glx_cx); + // if(glx_cx) glXMakeCurrent(display, (Window) GetClientAreaWindow(), glx_cx); } void wxGLCanvas::SetColour(const char *col)