Showing posts with label OpenGL ES. Show all posts
Showing posts with label OpenGL ES. Show all posts

Wednesday, May 11, 2011

Android OpenGL ES texture management.

My Android game is still 'coming along'. I'll be making an announcement post soon. It's consumed most of my late evening "dad time", I haven't touched a soldering iron in a while, I'll make up for lost time later.

Progress on the game has generally gone like this: bang out some framework code, bang out cool feature, cool feature, find a minor bug, spend the next few evenings pulling my hair out, framework code, cool feature, cool feature, rinse, repeat. This post is about one of those hair pulling moments and my solution. It revolves around Android's handling of the OpenGL texture buffer management API's.

Recently, I was reworking my texture management code in my "engine" (if you can call it that, it's really just a few folders of Java files with a focus on lower level Graphics and my own Collision detection). I wanted to add the ability to have "dynamic" textures, ones that could be created and modified in the middle of a game in progress. Android has been fun to work with, but the there is a dearth of documentation when it comes to the 3D stuff, you are typically refereed to external Open GL ES docs, or to the SDK samples, which invariably don't do what *you* are trying to do.

Disclaimer: Though I have been in the video game business for a long time, I have rarely done low level graphics rendering work. I would not consider myself a guru in that area, so take this post as food for thought and not as an authoritative doctrine. If you think I'm wrong on something, call me out!