What is the nicest way to close FreeGLUT?

前端 未结 4 1032
北海茫月
北海茫月 2021-01-02 03:49

I\'m really having trouble closing my console application with FreeGLUT.

I would like to know what the best way is to take every possible closing, because I don\'t w

4条回答
  •  滥情空心
    2021-01-02 04:50

    Thanks to Maarten's post, this works to me:

    glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_CONTINUE_EXECUTION);
    

    whenever you want to leave the mainloop without termiante the application use:

    glutLeaveMainLoop();
    

    don't forget to include "freeglut.h"

提交回复
热议问题