glDrawPixels vs. glBitmap rendering...

Started by
0 comments, last by michaelh 21 years, 5 months ago
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.
Advertisement
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.

This topic is closed to new replies.

Advertisement