Thursday, July 8, 2010

Week Two / Day Two

Another day of ups and downs. I only got to work until around 3.30 today as I had a doctor's appointment, but I still managed to get some decent work in. I continued working through the texture examples in the book, but unfortunately hit my first major bug with code from this book (whose praises I couldn't sing enough up until this point) while implementing a texturing format called PVRTC. I got PNG textures to work fine. I was able to load a texture in, read its image size from the raw data, parse it and use it as a texture. However, when attempting to use PVRTC, the book's method for getting the header information was funky, and I'm now using a middleware SDK provided by Imagination Technologies, the company who supplies Apple with the iPhone, iPod touch and iPad GPUs, the PowerVR SGX and MBR Lite. I've written to O'Reilly, the publishers of the book to see if they can help me with a solution. It's a problem with getting values from a struct pointer which is acting as though it hasn't been initialized. Normally this wouldn't be a big deal, but the initialization is done in a round-a-bout way using parts of the iPhone's Objective-C framework that I really haven't taken the time to learn. Losses have to be cut somewhere, and since I'm depending on Objective-C wrappers with a majority C++ code base, I don't really have the time to learn all the ins and outs of Cocoa touch and Objective-C.

Things weren't all bad today though. I'm starting to understand OpenGL better than I ever did before, and it's making me less worried about implementing things poorly as I've feared doing since I've started. For example, I finally got the touch screen figured out, but I still wasn't exactly sure about rendering the HUD for my game. I tried to make exact changes to the lines and models, but I felt like I didn't have true control over the space. Well, since I was working in 3D, I was rendering everything with a perspective view as the human eye, rather than an orthogonal view which creates a flat surface with no perspective. So all I had to do was switch between perspective and orthogonal spaces for drawing the 3D world and the interface respectively.

Tomorrow I'll be working primarily on fine tuning the interface and then trying to connect it up to a basic model for interaction. I could have the first "demo" of my game up and running tomorrow, a pretty exciting feat for 7 days on a brand new platform. Happy coding.

No comments:

Post a Comment