Both GLUT and libdispatch have their own event-handling loops, which are invoked with functions that never return: glutMainLoop();
and dispatch_main();
, respectively.
I've tried:
dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(q, ^{
glutMainLoop();
});
dispatch_main();
...and the window displays, but does not respond to any events or redraw after the initial call to the function specified with glutDisplayFunc()
.
How can I get GLUT and libdispatch to play nicely together?