Update: I tried changing the WaitEvent() to a combination of PeekEvent() (to see if there is an event in the queue, and if not, fall through and update the display like in a regular game loop) and PolEvent() (to process the event if one is waiting). The result of this is that WHILE you are moving the window and haven't stopped yet, it does update the display, albeit slowly because it is competing with the o/s code. Also it hogs the CPU a lot, so I added Delay 1 or even Delay 2 but this doesn't seem to be enough time, on a slow machine, to allow the o/s's gadgets to be looked at. The resize gadget does not work because there isn't enough CPU time. Obviously I can't give it enough CPU time on a slower machine that is already below the ideal framerate as there just isn't enough to go around, and not being called through the hook means the o/s gets strangled. So window resize doesn't work at all, but the title bar drag works to update when possible.
The other thing I tried is putting a Case EVENT_MOUSEDOWN in the hook, but this appears to never to be called - probably the mouse event is trapped by the WINDOWRESIZE and WINDOWMOVE events. I hoped maybe it would generate a mousedown event that I could use, when the user clicks the title bar or the resize button. Maybe I just need to put the event check for the mousedown before the others? Or maybe there just is not continuous events generated when the user is holding down the mouse button?
Either way it still isn't doing it right yet.
I basically need what would be the same result as a movie player window, which is playing an animation at a constant rate and doesn't stop playing even if the user is trying to resize or move the window.
Any other ideas?
(maybe I should try to detect MOUSEDOWN and keep a flag that it is down and only update the display in the main loop while that is `True`, then when a MOUSEUP event comes along stop using the main loop to update and rely on the timer from the hook?
[EDIT] I tried this, didn't work. There are no mousedown events for resizing the window while the mouse is held down and not being moved around.
Basically my update freezes until the user either actually adjusts the window size, or finishes moving the window. How can I get constant refresh? Is it even possible in MaxGUI? Is it a limitation of when the o/s generates events? Is there a workaround?
The other thing I tried is putting a Case EVENT_MOUSEDOWN in the hook, but this appears to never to be called - probably the mouse event is trapped by the WINDOWRESIZE and WINDOWMOVE events. I hoped maybe it would generate a mousedown event that I could use, when the user clicks the title bar or the resize button. Maybe I just need to put the event check for the mousedown before the others? Or maybe there just is not continuous events generated when the user is holding down the mouse button?
Either way it still isn't doing it right yet.
I basically need what would be the same result as a movie player window, which is playing an animation at a constant rate and doesn't stop playing even if the user is trying to resize or move the window.
Any other ideas?
(maybe I should try to detect MOUSEDOWN and keep a flag that it is down and only update the display in the main loop while that is `True`, then when a MOUSEUP event comes along stop using the main loop to update and rely on the timer from the hook?
[EDIT] I tried this, didn't work. There are no mousedown events for resizing the window while the mouse is held down and not being moved around.
Basically my update freezes until the user either actually adjusts the window size, or finishes moving the window. How can I get constant refresh? Is it even possible in MaxGUI? Is it a limitation of when the o/s generates events? Is there a workaround?