I have an application that uses one unique vbo to draw text.
What I do several times per frame is:
[b]DrawText[/b] dwSizeInBytes=dwNChars*4; glBindBufferARB(GL_ARRAY_BUFFER_ARB, uBufferID); glBufferDataARB(GL_ARRAY_BUFFER_ARB, dwSizeInBytes, NULL, GL_STREAM_DRAW_ARB); pRet=glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); Fill the buffer from the pRet pointer ... glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); glTexCoordPointer(2, GL_FLOAT, ...); glVertexPointer(2, GL_FLOAT, ...); glDrawArrays(GL_QUADS, 0, iNRealChars*4);
The problem comes when I draw some small texts with the same number of chars (dwSizeInBytes are the same in some consecutive calls) and the app runs at big FPS. In some consecutive calls, pRet gives me the same value, and just one text of those consecutive calls are drawn.
- If I slowdown the system. It works properly.
- If the texts have different sizes (dwSizeInBytes will be different) it works.
Also, If I put:
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 0, NULL, GL_STREAM_DRAW_ARB);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, dwSizeInBytes, NULL, GL_STREAM_DRAW_ARB);
it works properly.
- It works properly in ATI hw.
It is a rare problem because:
- You have to be re-using the same VBO with glMapBuffer.
- The amount of data should be the same between two consecutive passes.
Does anybody have similar problems? Am I doing something illegal?
It seems a bug for me.