Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an existing iOS game with fairly simple scenes (all textured quads) and I'm using Apple's "Texture2D" class. I'm trying to convert this class to use VBOs since the vertices of my objects basically never change so I may as well not re-create them for every object every frame.

I have the scene rendering using VBOs but the sizes and orientations of all rendered objects are strange and erratic - though locations seem generally correct. I've been toying with this code for a few days now, and I've found something odd: if I re-create all of my VBOs each frame, everything looks correct, even though I'm almost certain my vertices are not changing.

Other notes

  • I'm basing my work on this tutorial, and therefore am also using "IBOs"
  • I create my buffers before rendering begins
  • My buffers include vertex and texture data
  • I'm using OpenGL ES 1.1
  • Fearing some strange effect of the current matrix GL state at the time of buffer creation I've also tried wrapping my buffer-setup code in a "pushMatrix->loadIdentity->popMatrix" block which (as expected) had no effect
  • I'm aware that various articles have been published demonstrating that VBOs may not help performance, but I want to understand this problem and at least have the option to use them.

I realize this is a shot in the dark, but has anyone else experienced this type of strange behavior? What might I be doing to result in this behavior?

It's rather difficult for me to isolate the problem since I'm working in an existing, moderately complex project, so suggestions about how to approach the problem are also quite welcome.

share|improve this question

closed as off-topic by Josh Petrie Dec 16 '14 at 2:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about debugging a problem in your project must present a concise selection of code and context so as to allow a reader to diagnose the issue without needing to read all of your code or to engage in extensive back-and-forth dialog. For more information, see this meta thread." – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

Can you post your initialization/draw code? It's a little difficult to say exactly what would cause this behavior without seeing it. – user14497 Mar 19 '12 at 15:54
Could be the values you use for glDrawElements are getting over written or otherwise changed... Shot in the dark answer for a shot in the dark question I guess :) – Byte56 Mar 19 '12 at 19:09

Browse other questions tagged or ask your own question.