I've created an application with Qt Creator (OS Ubuntu 13.04). One function creates a window and draws a graphic using GLUT library, picture is right. But when I try to close window and continue working with my program, it terminates. How can I avoid this?
There is the code of my function:
void plot(int argc, char**argv,.../*other arguments*/)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_ALPHA);
glutCreateWindow("Green Window");
//some code
//...
glutDisplayFunc( draw );
glutMainLoop();
}
Application output prints "... exited with code 0"
glutMainLoop
doesn't return, you should use Qt's builtin support for OpenGL rendering. – Renvoi