Brian Keener wrote: > OSG completes its build now with the new libglut32.a. Excellent. > It builds an example > program osgviewerGLUT.exe which opens a window and diplays an image. When I > click the close box on that window I get a segmentation fault when the app > closes. The app will also close when you simply press the escape key. This > leaves the process running in the background as if I had used the hack > -DGLUT_DISABLE_ATEXIT_HACK. > When I used the escape I had to kill the process manually. Not sure if this > is > a glut issue or an issue with their example window but thought I would let > you > know. > bk Hi Brian, I took a look at osgviewerGLUT. Did that ever worked well with some previous version of the opengl package? I see a few strange things: void keyboard( unsigned char key, int /*x*/, int /*y*/ ) { switch( key ) { case 27: // clean up the viewer if (viewer.valid()) viewer = 0; glutDestroyWindow(glutGetWindow()); break; //... } }
Typing esc only destroys the window without stoping the program, which continue with a dangling viewer pointer; no wonder that you have to kill it manually. Instead of calling glutDestroyWindow(glutGetWindow()); it should call exit(0); , maybe after calling delete viewer; . void display(void) { // update and render the scene graph if (viewer.valid()) viewer->frame(); // Swap Buffers glutSwapBuffers(); glutPostRedisplay(); } glutPostRedisplay(); will have display() called again, so it creates an infinite loop. It should not be there. glutPostRedisplay(); should rather be at the end of mousebutton, mousemove, and keyboard. Closing the window with the (X) icon should result in simply calling exit(0) and destroying the window. As to why it segfaults, you would have to degug it, as I don't have OpenSceneGraph installed. Regards, - André Bleau, Cygwin's volunteer OpenGL package maintainer. Please direct any question or comment about the OpenGL package to cygwin at cygwin dot com _________________________________________________________________ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/