PDA

View Full Version : glBitmap on FBO



Peter Maarssen
02-05-2008, 06:50 PM
Hello,

I have a problem displaying my font:

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glClear(GL_COLOR_BUFFER_BIT);
glRasterPos2i(x, y);
glListBase(fontOffset);
glCallLists(strlen(string), GL_UNSIGNED_BYTE, string);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

glBindTexture(GL_TEXTURE_2D, tex);
glLoadIdentity();
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2d(1f,1f); glVertex3f(1024f,1024f,0f);
glTexCoord2d(0f,1f); glVertex3f(0f,1024f,0f);
glTexCoord2d(1f,0f); glVertex3f(1024f,0f,0f);
glTexCoord2d(0f,0f); glVertex3f(0f,0f,0f);
glEnd();

on the fbo:

glGenFramebuffersEXT(1, &fbo);
glGenTextures (1, &tex);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1024, 1024, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

Displaying textures on the fbo is no problem and displaying the font on the framebuffer also works fine, but displaying my font on the fbo works really strange: it looks a bit like it only changes the alpha or something :(

Thanks.

Peter Maarssen
02-06-2008, 03:29 AM
Ha, and here I thought I updated my drivers. (roll back is my thought atm)
But thats it, a driver bug. Everything is working fine now.

If anybody using a nvidia card could tell me this kind of thing works fine on their hardware as well that would be even more reassuring.