cdave1 / ftgles

A truetype font rendering library for OpenGL ES on iOS devices (iPad and iPhone)
http://cdave1.github.io/ftgles/
MIT License
142 stars 36 forks source link

Issue with VBOs #4

Closed esunder closed 14 years ago

esunder commented 14 years ago

I am following the "Basic Demo" very closely in my own application. I am using a FTTextureFont to render a "hello, world" string. It works flawlessly until I load vertices into a VBO, i.e. glGenBuffers(), glBindBuffer(), glBufferData().

I have singled it down to the glBufferData() call. If I make that call, the font stops rendering. It appears to go through the process of rendering, (iterating over all of the characters in the string, etc), it just does not display on the screen. As soon as I comment out glBufferData and recompile, the text shows up on screen again.

I am currently using the latest version of XCode and my engine is currently using OpenGLES 1.1 because I have an iPhone 3GS (no 2.0 for me, yet).

Any ideas?

esunder commented 14 years ago

FIXED: int x; // Create 1 new buffer glGenBuffers(1, &x);

// Bind to our new buffer glBindBuffer(GL_ARRAY_BUFFER, x);

// Upload the vertex data glBufferData( .... );

// Make sure you UNBIND the buffer by binding to 0 // This is the part I was missing and I think my index/vertex buffers were staying bound when FTGLES font went to render. glBindBuffer(GL_ARRAY_BUFFER, 0);

cdave1 commented 14 years ago

Cool! Might still have a look at the FTGLES to see if it can be improved in this area.