Re: [wxVTK] wxVTKRenderWindowInteractor.cxx, 1.47, 1.48
Brought to you by:
malat
From: Pierre F. <pie...@gm...> - 2009-03-05 15:35:19
|
On Thu, Mar 5, 2009 at 4:24 PM, Sander Niemeijer <nie...@st...>wrote: > Hi Pierre, > > I have two comments: > > I would suggest making the definition of wxvtk_attributes static. This will > prevent the symbol becoming exported. Sure. I'll change it to static. > > > Also, you have removed the wxCHECK_VERSION(2, 8, 0). Are you sure that your > invocation of the wxGLCanvas constructor will also work with versions of > wxWidgets before 2.8? I guess so. Previous versions of wx allowed to call the wxGLCanvas constructor with zero argument (all were defaulted to some values in the header) which was changed in recent versions. The current constructor seems to be "backward compatible", but I may be wrong. Problem is that I have to call the constructor with all its arguments to pass it the openGL attribute list, which is the only possibility to pass it. Otherwise I can do my openGL trick only for wx>2.8 and leave constructor unchanged for older versions (but the flickering problem may persist). Best, Piere. > > > Best regards, > Sander > > > On 5 mrt 2009, at 15:58, Pierre Fillard wrote: > > Message: "Added a wxGLCanvas attribute list to the >> wxVTKRenderWindowInteractor constructor to force OpenGL double buffering to >> be ON by default. >> This trick solves some flickering issues on some graphic hardwares, the >> other will (or should) behave normally." >> >> Checking in src/wxVTKRenderWindowInteractor.cxx; >> /cvsroot/wxvtk/wxVTK/src/wxVTKRenderWindowInteractor.cxx,v <-- >> wxVTKRenderWindowInteractor.cxx >> new revision: 1.48; previous revision: 1.47 >> done >> >> >> Index: src/wxVTKRenderWindowInteractor.cxx >> =================================================================== >> RCS file: /cvsroot/wxvtk/wxVTK/src/wxVTKRenderWindowInteractor.cxx,v >> retrieving revision 1.47 >> diff -u -r1.47 wxVTKRenderWindowInteractor.cxx >> --- src/wxVTKRenderWindowInteractor.cxx 3 Mar 2009 16:20:42 -0000 >> 1.47 >> +++ src/wxVTKRenderWindowInteractor.cxx 5 Mar 2009 14:51:34 -0000 >> @@ -137,13 +137,19 @@ >> vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.47 $") >> vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor) >> >> >> -//--------------------------------------------------------------------------- >> #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) >> -#if (wxCHECK_VERSION(2, 8, 0)) >> -wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : >> wxGLCanvas(0, -1, wxDefaultPosition), vtkRenderWindowInteractor() >> -#else >> -wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : >> wxGLCanvas(), vtkRenderWindowInteractor() >> +int wxvtk_attributes[]={ >> + WX_GL_DOUBLEBUFFER, >> + WX_GL_RGBA, >> + WX_GL_DEPTH_SIZE, >> + 16, >> + 0 >> +}; >> #endif >> + >> >> +//--------------------------------------------------------------------------- >> +#if defined(__WXGTK__) && defined(USE_WXGLCANVAS) >> +wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : >> wxGLCanvas(0, -1, wxDefaultPosition, wxDefaultSize, 0, >> wxT("wxVTKRenderWindowInteractor"), wxvtk_attributes), >> vtkRenderWindowInteractor() >> #else >> wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), >> vtkRenderWindowInteractor() >> #endif //__WXGTK__ >> @@ -170,7 +176,7 @@ >> long style, >> const wxString >> &name) >> #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) >> - : wxGLCanvas(parent, id, pos, size, style, name), >> vtkRenderWindowInteractor() >> + : wxGLCanvas(parent, id, pos, size, style, name, wxvtk_attributes), >> vtkRenderWindowInteractor() >> #else >> : wxWindow(parent, id, pos, size, style, name), >> vtkRenderWindowInteractor() >> #endif //__WXGTK__ >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> >> http://p.sf.net/sfu/XcvMzF8H_______________________________________________ >> Wxvtk-users mailing list >> Wxv...@li... >> https://lists.sourceforge.net/lists/listinfo/wxvtk-users >> > > |