The game engine has been coming along quite well recently. I’ve been doing a lot of work on it, as it’s school holidays.
I moved all the image code over to OpenGL, which was surprisingly easy. All I had to do was change a bit of initialisation code, and then rewrite the code that draws bitmaps. Instead of blitting them onto the screen, now images are rendered as textures. This gives me some very big advantages. Firstly, I have to call one command to rotate an image – something I was having a lot of trouble doing before. Also, I should be able to make it more resolution independent, and allow the user to play the game fullscreen.
I was having some trouble initially with OpenGL – I was just getting a black screen. Eventually I found that I was clearing the screen after drawing everything… At least then I could get white (or coloured) rectangles to render, but I was still having problems mapping the texture to them. After a long, frustrating debug session, I found that I had just accidentally put two arguments around the wrong way on a function call… Suddenly everything worked perfectly!