iDevGames Forums
Vertex buffer generation and rendering iphone - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Vertex buffer generation and rendering iphone (/thread-2062.html)



Vertex buffer generation and rendering iphone - eliscool - Dec 8, 2008 05:19 PM

Hey Guys.. i've been trying a bunch of stuff to speed up the rendering of my iphone game, I dont know how these big 3d/racing games are squeezing so much performance out of it! and im only making a 2D side scroller. I seem to be getting around 20-30fps depending on action, which I would really like a solid 30fps.

So one thing I wanted to do was to render all sprites that are the same (especially targed towards my particle system) at once, by malloc'ing some memory and adding all the verticies into that, then rendering the vertex buffer as an eg. tri strip, I tried several different tactics, but only managed to ever get the first sprite (two tris) to draw properly... I must be doing something fundamentally wrong, though im not sure what. Does anyone have some example code on how the managed to get this working? the help would be GREATLY appriecated.

Eli


Vertex buffer generation and rendering iphone - eliscool - Dec 17, 2008 05:24 PM

anyone? Sad


Vertex buffer generation and rendering iphone - ThemsAllTook - Dec 17, 2008 05:57 PM

It sounds like you'd actually want to use GL_TRIANGLES rather than GL_TRIANGLE_STRIP, unless all of your sprites happen to be directly connected. Other than that, your approach ought to work, assuming all of the sprites you're rendering use the same texture.