← Back to team overview

yade-users team mailing list archive

Re: glutInit() problem.

 

Ye Yonggeng said:     (by the date of Mon, 26 Jun 2006 11:18:46 +0200)

> Hi, Janek,
> 
> Thank you for your advice, I get the latest version from svn and fix the
> problem about boost lib.
> 
> When I compile with libQGLViewer-2.2.2-3, I have to change a function
> name: GLSimulationPlayerViewer.cpp, setSnapshotFilename ->
> setSnapshotFileName

yes, the new version of qglviewer changed the function name.

> then, compile successfully.
> 
> But When I click menu "New Simulation", the same problem as Tal's
> "Segmentation Fault" occurs, then the main window disappears magically.
> 
> I use Ubuntu 6.06 and compiler is not old.
> 
> Do you have idea about that?

yes, I know that. today I will post a longer explanation (still
finishing it up), but the fix is following:

in file:

yade-packages/yade-package-common/src/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp


 void OpenGLRenderingEngine::render(const shared_ptr<MetaBody>& rootBody)
 {
+       static bool initDone=false;
+       if(!initDone)
+       {
+               int a=1;
+               char* b="./yade";
+               glutInit(&a,&b);
+               initDone=true;
+       }
+
        const GLfloat pos[4]    = {lightPos[0],lightPos[1],lightPos[2],1.0};
        const GLfloat ambientColor[4]   = {0.5,0.5,0.5,1.0};


-- 
Janek Kozicki                                                         |
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
http://lists.berlios.de/mailman/listinfo/yade-users



Follow ups

References