View Single Post
Old 24 November 2018, 22:49   #175
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,343
Yes, you're right, it's not a solution for every situation, just an alternative to bear in mind. It all depends on what your main loop is doing. Sometimes main loops can run continuously, e.g. when your program does some sort of processing, or in the case of most games. You can limit the amount of CPU time your program uses in a loop like that with VWait, or the Delay_ system call.

Another friendly alternative for programs that do use WaitEvent, is to add the #IDCMP_INTUITICKS flag to your window's IDCMP list. This triggers an event roughly every 0.1 seconds, making it useful for animation and other tasks in a program loop that uses WaitEvent, however it will only work while the window is active.
Daedalus is online now  
 
Page generated in 0.04474 seconds with 11 queries