[Main]
Name=GrayWaitNSwitches
Type=Function
Subtype=Macro
Header Files=gray.h
Definition=void GrayWaitNSwitches (short wait);
Real Definition=#define GrayWaitNSwitches(n) ({unsigned long __w = __switch_cnt + (n); while (__switch_cnt < __w);})
See Also=gray.h/GrayGetSwitchCount

[Description]
Waits for a given number of plane switches.

[Explanation]
GrayWaitNSwitches waits for <I>wait</I> plane switches to happen before
returning. If <I>wait</I> is 1, the function waits until the next plane
switch occurs, so you can synchronize your program to the grayscale plane
switches. Since the switches happen periodically, you can be pretty sure that
no switch will occur too soon after you call this function. Using
<A HREF="$$LINK(gray.h/GrayGetSwitchCount)">GrayGetSwitchCount</A> and
<A HREF="$$LINK(gray.h/GraySetSwitchCount)">GraySetSwitchCount</A>, you can also
choose exactly after which plane the function returns.
