MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / event_loop_multi

Function event_loop_multi

demos/glthreads.c:425–451  ·  view source on GitHub ↗

* Separate display connection for each thread. */

Source from the content-addressed store, hash-verified

423 * Separate display connection for each thread.
424 */
425static void
426event_loop_multi(void)
427{
428 XEvent event;
429 int w = 0;
430
431 assert(MultiDisplays);
432
433 while (!ExitFlag) {
434 struct winthread *wt = &WinThreads[w];
435 if (XPending(wt->Dpy)) {
436 XNextEvent(wt->Dpy, &event);
437 switch (event.type) {
438 case ConfigureNotify:
439 resize(wt, event.xconfigure.width, event.xconfigure.height);
440 break;
441 case KeyPress:
442 keypress(&event, wt);
443 break;
444 default:
445 ; /* nop */
446 }
447 }
448 w = (w + 1) % NumWinThreads;
449 usleep(5000);
450 }
451}
452
453
454

Callers 1

mainFunction · 0.70

Calls 3

XNextEventFunction · 0.85
resizeFunction · 0.70
keypressFunction · 0.70

Tested by

no test coverage detected