An OpenGL ES Adventure – Part 4

I started work on a simple texture manager today, to add a bit of life to meshes. To test it I wrote a basic skybox class that takes 6 images and renders them to a cube. The attached screenshots are from an iPhone, since anti-aliasing (I implemented this too) doesn’t seem to work on the simulator:

I’m also nearly finished moving all of my GL calls into a new Abstract Graphics Layer (AGL). The purpose of this is to make the code more modular, allowing for additional graphics libraries to be added without touching the rest of the engine code. Instead of using the following code:

glGenBuffers(1, &mBufferID);
glBindBuffer(GL_ARRAY_BUFFER, mBufferID);
glBufferData(GL_ARRAY_BUFFER, sizeof(mVertexArray), mVertexArray, GL_STATIC_DRAW);
....
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(VertexPN), 0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(VertexPN), (GLvoid*) (sizeof(F32) * 3));
glDrawArrays(GL_TRIANGLE_STRIP, 0, mVertexCount);

I can do the following:

mVertexBuffer = ResourceManager::getVertexBuffer("Sphere_50", eBufferStatic);
mVertexBuffer->setVertexArray(mVertexArray);
....
mVertexBuffer->useBuffer();
mVertexBuffer->renderBuffer(mVertexCount);

The resource manager will automatically return a pointer to the correct VertexBuffer subclass based on global configuration; in this case it returns a GLVertexBuffer.

Finally, given that my codebase is starting to get fairly large, I’ve decided to start using MantisBT to maintain to-do lists and keep track of bugs. I’m running a local WAMP server on my desktop, so I can quickly access the bug tracker any time I find something that I need to come back to later. Although it’s team-oriented, Mantis has already been very helpful in keeping on top of things even for a single developer.

That’s all for the time being, stay tuned!

T

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: