Vertex buffer generation and rendering iphone

Apprentice
Posts: 6
Joined: 2008.11
Post: #1
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
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2008.11
Post: #2
anyone? Sad
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #3
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  New Apple Render to Vertex Buffer Sample OneSadCookie 13 7,691 Oct 15, 2006 01:10 AM
Last Post: OneSadCookie
  2D Image Generation & openGL LWStrike 2 3,453 Mar 28, 2006 03:34 PM
Last Post: OneSadCookie
  stack overflow creating a vertex buffer? LongJumper 6 5,084 Jul 5, 2005 10:39 PM
Last Post: PowerMacX
  display list generation honkFactory 8 3,582 Mar 13, 2003 11:39 AM
Last Post: honkFactory