I was inspired by Sanjay’s Breakernoid project, and thought I’d crank out a quick Space Invaders clone this morning as more practice with C#/MonoGame. In particular, I wanted to work out per-pixel collision detection and see what neat effect I could get on the bunker destructions.
To keep things retro looking, I plan to render a bunch of low-rez graphics to a texture and then scale that texture to whatever size window the user has set. That’s when I ran into my first (for today, at least) MonoGame-SDL2 bug.
It looks like setting the .Window.AllowUserResizing attribute to true is not making the SDL window resizable. So, I created an issue for flibijibibo (Ethan Lee) to investigate: https://github.com/flibitijibibo/MonoGame/issues/139. Flibijibibo’s always been pretty quick to squash the previous bugs I’ve reported, so I doubt the issue will live long.
Oh well, I’m going to take it as a sign I should take a break for now and pick this up later. 🙂
Update: Well that didn’t take long. Ethan pointed out https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/SDL2/SDL2_GameWindow.cs#L69, which indicates that it’s actually a problem with the SDL2 Video API not allowing the mode of the window to change. I uncommented the line from the link and recompiled a version of MonoGame-SDL2 that outputs resizable windows.