c++ - How to close GLUT window without terminating of application? -


i've created application qt creator (os ubuntu 13.04). 1 function creates window , draws graphic using glut library, picture right. when try close window , continue working program, terminates. how can avoid this?

there code of 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 code 0"

if read e.g. this reference of glutmainloop see glutmainloop never returns. means call exit directly instead of returning.

if you're using qt, it's able open windows containing opengl contexts, windows compatible rest of qt , can close @ will.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -