I’m working on a tile based side scroller game using OpenGL for the graphics. I like OpenGL alot more than any of the Microsoft-based graphic APIs, so please hold the complaints.
Anyway, here’s my question. Right now the way I’m drawing the tiles involves arrays of floats. The game engine supports “solid” square tiles as well as inclined tiles and stair-shaped tiles for variety. During the rendering phase, each tile’s shape is checked, and depending on what shape it has, one of the different arrays is drawn.
I thought I could optimize this a bit by turning each array into a display list, so the rendering function would be able to just call one list per tile.
I keep the arrays in global variables so that they don’t have to be initialized for every frame that renders, and converting the tiles to display lists would give me a little more elbow room if I got rid of those monsters.
Oh yeah, I don’t mean a “true” vertex array in the OpenGL sense, I just have an array of eight floats that define the vertices of the tile, then I call glVertex2fv() four times with an incrementing address.
So, would the extra effort of rewriting the rendering function and creating display lists really be worth it?