In my day job I have had to write a remote physics debugging app. It talks to a game using UDP and displays lot’s of graphs and such to help debug the physics.
It works really nicely, but I screwed up.
Me being me, I wanted it to look good as well as work, so I used Monogame and did it right.
Now they are talking about eventually releasing it to the public.
Sigh. I should have used some shitty freeware WPF toolbox. Too late now.
So I had one big problem to solve.
It has to run on a second monitor, so I just had it running in windowed mode so you could drag it around and resize it at will, which meant I had the ugly white title bar at the top.
Which I now have had to get rid of.
I did this by changing the window style to WS_THICKFRAME and implementing my own window dragging code (a hell of a lot of work as it turned out, I think we may have to do something about that)
Then turned to maximise window.
This threw up a lot of problems.
The first thing I noticed is that the Adapter on GraphicsDevice DOES NOT CHANGE when you drag the window from one monitor to another.
This may be because removing the title bar from the window screws up the code in Monogame.
So I had to drag in GetMonitoFromRect and GetMonitorInfo from user32.dll
And using that I could get close to what I want. Not exactly what I want as I still have small issues with the sizing of the window.
It looks like setting the display area on GraphicsDevice does not allow for the size of the border when Monogame is running windowed
So in short …
Dragging windows around can break GraphicsDevice adapter settings
Resizing GraphicsDevice may need looking at when windowed