Archived

This topic is now archived and is closed to further replies.

michaelh

glDrawPixels vs. glBitmap rendering...

Recommended Posts

Hello, I am using an FTGLish interface to freetype2. I have been able to draw the text successfully with glDrawPixels and textures, however, I get a distorted image when using glBitmap. Here is a snippet of my glDrawPixels code that works: glDisable (GL_ALPHA_TEST); glEnable(GL_ALPHA); glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glPixelStorei (GL_UNPACK_ALIGNMENT, 1); // Move the glyph origin glBitmap( 0, 0, 0, 0, -right, -left, NULL); glDrawPixels (Width, Height, GL_ALPHA, GL_UNSIGNED_BYTE,(const GLubyte *) data); // Restore the glyph origin glBitmap( 0, 0, 0, 0, right, left, NULL); Using the same code replacing glDrawPixels with glBitmap: glBitmap(Width, Height, 0, 0, 0, 0, (const GLubyte*)data); I get a distorted image rendered. (illegible fuzzy horizontal lines.) What do I have to do differently to get glBitmap to render the image properly? Thanks, Mike.

Share this post


Link to post
Share on other sites
glBitmap operates at the bit level so that every bit in the bitmap becomes an individual pixel. You''ll need to convert every pixel of your image to a single bit value if you want to use glBitmap.

Share this post


Link to post
Share on other sites