Monogame freezes when dragging the game window

Hi, Im new to Monogame.

I try to do a simple Window (drawing randow rect) with Shared project DesktopGL with Monogame 3.7.1

When I move the window, Monogame freeze a game.

I try to apply solutions that i found in stackoverflow and in this comunity site without success (clone git repo and try to build and found many errors).

|Error|CS2001|Source file ‘\MonoGame.Framework…\ThirdParty\NVorbis\NVorbis\BufferedReadStream.cs’ could not be found.|MonoGame.Framework.WindowsGL|\MonoGame-master\MonoGame.Framework\CSC|1|Active|

Can anyone help me to solve this issue?

Thanks in advance.

pd: Sorry for my English.

Im not 100% on this but i believe

  1. update continues to execute when dragging.

  2. draw doesn’t

  3. Monogame does that on purpose as a choice for reasons which i forget exactly why.

1 Like

Hi @Oscar_Santos, Welcome to the forum!

Read here:

Another good read:

I would suggest keeping your draw code and positioning code separate and resume update from updated positions instead of pushing draw calls, probably a better idea to detect drag behaviour to pause draw calls but keep movement going.

Games like FTL manage this pretty well with the option to pause the game when it is detected that the mouse is outside of the game window.

Working around it is a better option.

A good thing to do is use both your normal language and English, but do let us know you speak Spanish and not Portuguese or something so that we can translate faster by not having to guess what language you are speaking to help better.

Happy Coding!

1 Like