int mav_eventsCheck(void);
The return value of the callback forms the return value of this function. If no events are detected the return value is zero. If, and how, this return value is interpreted is an application-specific issue. For example, it could be used to control the drawing of frames. Consider the following three rendering loops:
while ( 1 ) { if ( mav_eventsCheck() ) { /* draw frame */ } }while ( 1 ) { mav_eventsCheck(); /* draw frame */ }
while ( 1 ) { while ( mav_eventsCheck() ) {} /* draw frame */ }
The first loop would only draw a new frame in response to an event occurring for which the callback function returns a true value. The second loop ignores the return value and draws frames in a continuous loop. The third example processes all outstanding events before drawing a frame.