I have written a port of Quake 1 for the Raspberry Pi, I'm using my own wrapper for the graphics calls and currently average 30fps when running the demos but there are some dips to as low as 14 fps when certain things happen on screen (for example the explosions from the grenade launcher). I would be very grateful for any hints on how to make things a bit more consistent.
In my graphics wrapper I malloc a fairly large pool to store vertex data (position, colour, uv coordinates) which is filled between glBegin/glEnd with calls to glVertex3f etc. That data is only sent to the GPU when either the game tries to make a state change that would require the previously held data to be drawn (such as a change in bound textures, or blending mode) or when the buffer gets full.
This lets me batch a lot of drawing calls like when drawing the console, which originally was a call per character to draw a quads but is now only a couple of draw calls.
I have also changed the drawing of Entities (monsters and non static objects in the scene) to use triangles instead of constantly switching between triangles fans and triangle strips. This adds extra data to send to the GPU but greatly reduced the number of draw calls (it went from typically 300~500 per frame to less than 80) and improved performance.
When sending the data I use glBufferSubData followed by glBufferData with null to orphan the vbo and apparently avoid synching ( see http://www.opengl.org/wiki/Buffer_Object_Streaming
), this improved the performance too.
I thought glMapBufferOES would allow me to avoid having to malloc and send the data myself, but a very quick attempt at using it completely killed the framerate (to about 1fps) are there any pitfalls i might be running into with this version?
There are still a few things I need to iron out before I put the code up, Quake doesn't seem to be freeing any of the textures it creates, and my kb/mouse input code which worked when I first bought the pi seems to have stopped working.
Thanks for any help.