What is the nicest way to close FreeGLUT?

前端 未结 4 1008
北海茫月
北海茫月 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:40

    I use glutDestroyWindow(int handle);

    or

    According to ID: RigidBody at OpenGL forum

    void destroy_window() 
    {
     window_valid = -1;
    }
    
    void display_func() 
    {
     if(window_valid == -1)
       return;
     // draw things
    }
    

提交回复
热议问题