OpenGL bitmap drawing after PBO binding

PBOs, as well as textures, must also be unbound before bitmap drawing routines (or any other drawing). Otherwise bitmaps will not be drawn. For example:

glBegin(GL_QUADS);
// draw
glEnd();

// unbind them!
glBindTexture(GL_TEXTURE_2D, 0);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);

// raster drawing
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
glRasterPos2f(some_x, some_y);
glutBitmapString(GLUT_BITMAP_HELVETICA_12,
	(unsigned char*)"some message");

Here above, glutBitmapString will not show anything unless you call glBindBuffer with 0 to unbind the buffer. The same is required with the texture.

The tip is taken from this article: Text disappears when initializing PBO/Textures

Regarding PBO in general, this is a very nice tutorial: OpenGL Pixel Buffer Object (PBO)

Advertisements
OpenGL bitmap drawing after PBO binding

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s