Quote:
Originally Posted by
willil
I've found that checking for the interrupts can increase display times by 30-50%.
Look for the following:
1. XtAppAddWorkProc/XtAppRemoveWorkProc
2. XtAppNextEvent, XtAppPending, XtAppPeekEvent, XtAppProcessEvent, Xt DispatchEvent, XtAppMainLoop
3. XExposeEvent
I try and avoid threads with Xwindows programming.
One solution is to use XExposeEvents to accumulate invalidated rectangles into a region, then when the count hits zero, schedule a work proc to some some drawing. In the work proc do a small amount of drawing covering only the invalidated region, then remove what you have painted from that region. Then if the region is not empty, schedule another work proc.
Alternatively use one of the XtAppPending family of functions to see if there any any incoming messages, if not then continue with a small amout of drawing. As above, restrict yourself to only parts that have been indicated by an XExposeEvent.