I will try...
So I have a server,which listen on port. This is main thread. Depending on what information it accepted I run other thread with glut aplication. Here is the method run:
void Sporic::run() {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowPosition(5, 5);
glutInitWindowSize(WIDTH, HEIGHT);
/* Create main window and set callbacks. */
this->win = glutCreateWindow(TITLE);
glutDisplayFunc(myDisplay);
glutReshapeFunc(myReshape);
glutIdleFunc(myIdle);
/* Create main menu. */
glutCreateMenu(myMenu);
glutAddMenuEntry("Quit", 99);
/* Menu will be invoked by the right mouse button */
glutAttachMenu(GLUT_RIGHT_BUTTON);
init();
/* Run endless main loop to process events. */
glutMainLoop();
}
void Sporic::run() {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowPosition(5, 5);
glutInitWindowSize(WIDTH, HEIGHT);
/* Create main window and set callbacks. */
this->win = glutCreateWindow(TITLE);
glutDisplayFunc(myDisplay);
glutReshapeFunc(myReshape);
glutIdleFunc(myIdle);
/* Create main menu. */
glutCreateMenu(myMenu);
glutAddMenuEntry("Quit", 99);
/* Menu will be invoked by the right mouse button */
glutAttachMenu(GLUT_RIGHT_BUTTON);
init();
/* Run endless main loop to process events. */
glutMainLoop();
}
To copy to clipboard, switch view to plain text mode
and now I want to stop this thread but i dont know how. I must close this glut window but glut function glutDestroyWindow(this->win); doesnt work.
Bookmarks