‘Not Bad OpenGL Introduction’
I’ve been playing around with OpenGL on my phone for a few weeks now. It all started with me wanting to do something simple…
I had this idea for a Live Wallpaper, and I figured it would be a fun distraction for a few hours over Christmas. The idea was pretty simple, but (as often happens) the naive, simplistic approach didn’t work.
Throughout all this I’ve been both impressed by just how powerful phones are, and depressed by how woeful some of the performance is. They’re incredibly fast, but canvas.drawText() is just not up to what I asked it to do. I was getting around 3 frames per second, and putting the processor under quite a load.
So, I wondered what the hardware acceleration in the handset could do to help. And that brought me to OpenGL.
I read some OpenGL pages and guides on the net, and got something sortof working, but I didn’t feel comfortable I knew what it was doing and it turned out that I needed at least OpenGL 2, because OpenGL 1 couldn’t do some of the texture work I needed. At this point I gave up on the net and bought a couple of books.
This book helped. It was similar in tone to some of the tutorials out there, but it went a bit deeper and a lot further. I learned stuff, and for that it was worth the money.
I do have some quibbles with it though. I don’t think I like the approach of copying-and-pasting projects followed by renaming things from chapter to chapter. It seems amateurish compared to the professional approach elsewhere in the book, and the fact that it used Eclipse when I was using IntelliJ was annoying.
Worse though was the way some of the code changes were described. In the chapter on textures I had some difficulty following along – the book would say do-this, then do-that and so on, but wouldn’t give a lot of explanation why. You ended up writing a method when you’d no clue about its purpose, and six pages later in a different class you’d find the call to it but again without much explanation. It felt like a Chinese Room – yes, I could follow along and make the changes, and at the end my code would be correct and would do what it was supposed to, but I had no understanding of what I had just done nor why it worked.
Some chapters left me feeling like that while others didn’t, so maybe the pacing wasn’t right for me, or maybe I was just useless at grasping some of the concepts.
Still, to get up to speed on an unfamiliar language and platform it was worth the money.