X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtk3DBaseView.cxx;h=334104671c35e4cb36e97ff588fc8a3098ea9d4b;hb=542063db4a06b1a74587bcab7d5c450ebdd53272;hp=75d6c1e7a346018d19f30492560f01ee9c6ff113;hpb=cf42d2bd2f87434922bf9f6f3f520b3f8ad2ba64;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index 75d6c1e..3341046 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -37,7 +37,7 @@ wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata) _configure = false; _aRenderer = NULL; _renWin = NULL; - _aCamera = NULL; + _aCamera = NULL; } //------------------------------------------------------------------- wxVtk3DBaseView::~wxVtk3DBaseView() @@ -45,10 +45,12 @@ wxVtk3DBaseView::~wxVtk3DBaseView() if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;} if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;} - if (_renWin!=NULL) { + if (_renWin!=NULL) + { if(_renWin->GetReferenceCount()==0) { - _renWin -> Delete(); _renWin=NULL; + _renWin->Delete(); + _renWin=NULL; } } } @@ -152,6 +154,20 @@ void wxVtk3DBaseView::Configure() //wxVtkBaseView::Configure(); _aRenderer = vtkRenderer::New(); _renWin = vtkRenderWindow::New(); + + int supportopengl=_renWin->SupportsOpenGL(); + printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl ); + printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() ); + if (supportopengl==0) + { +#if defined(_WIN32) + printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n Copy from \\CreaTools\\crea_TPdlls-4.0.0\\bin\\opengl-mesa\n the file: opengl32.dll\n to \\CreaTools\\CreaTools-3.0.0\\bin \n"); +#else + printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n"); +#endif + exit(0); + } + _renWin->AddRenderer(_aRenderer); _aRenderer->GradientBackgroundOn(); @@ -200,10 +216,10 @@ void wxVtk3DBaseView::Configure() GetCamera()->Roll(180); GetCamera()->Yaw(180+30); GetCamera()->Pitch(-22); - - + } } + //------------------------------------------------------------------- //EED 27 sep 2006 void wxVtk3DBaseView::GetSpacing(double spc[3])