Qt Creator(OS Ubuntu 13.04)でアプリケーションを作成しました。 1つの関数はウィンドウを作成し、GLUTライブラリを使用してグラフィックを描画します。しかし、ウィンドウを閉じて自分のプログラムで作業を続けようとすると、プログラムは終了します。どうすればこれを避けることができますか?アプリケーションを終了させずにGLUTウィンドウを閉じる方法は?
私の関数のコードがあります:あなたは、例えば読めば
void plot(int argc, char**argv,.../*other arguments*/)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_ALPHA);
glutCreateWindow("Green Window");
//some code
//...
glutDisplayFunc(draw);
glutMainLoop();
}
アプリケーション出力プリントは
これはQtのGUIプロジェクトですか? Qt Creatorを使って基本的なC++プロジェクトを作成していますか? –
はい、Qt GUIでメインウィンドウを作成します。 –
その場合、前述の@JoachimPileborgのように、 'glutMainLoop'が返ってこないので、OpenGLレンダリングのためのQtの組み込みサポートを使うべきです。 –