Window drag pausing

About Monkey 2 Forums Monkey 2 Programming Help Window drag pausing

This topic contains 3 replies, has 3 voices, and was last updated by  Hezkore 1 year, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #13784


    I’m trying to get rid of the pause that happens when you drag the window.
    I really just need the logic to keep going in the background, rendering isn’t as important.
    Anyone got any clues to how I could do this without altering any of the Mojo code?


    Abe _King_

    Not sure how much I can help, but if monkey2 has a way to utilize timeout functions that run on a separate thread – then I have one idea off the top of my head.

    Since your main thread stops when being dragged, the code only needs to be executed in whatever function is most appropriate (I’d assume render in a window is).

    Psuedo code:
    1. make timer

    2. pass timer a function

    3. when timer timeout it will execute function

    4. in the render method, keep resetting the timeout to something reasonable
    5. now whenever the main method is paused the timer will eventually run out and you can loop it!

    This is fairly unorthodox and there are more SDL2 like ways. Here’s a thread I found that kind of covers that topic:


    Mark Sibly

    You’ll need to stick your update code into OnRender to do this as this is the only callback that continues to be processed while windows goes ‘modal’.



    I haven’t been able to get this working, no matter what I try.
    I’ve tried timers, I’ve tried fibers and I’ve tried altering the Mojo App code.

    I at first thought the timer method worked, but it just catches up real fast when you release the window.
    It doesn’t actually keep running while you’re dragging it.

    I’m playing/reading/processing some music files, and I need it to keep doing so even when you drag the window around.
    If it pauses and catches up when you release the window, it will just play every instrument and sample in a mess.

    @Mark Sibly
    I’ve got my update code in OnRender.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.