On MS Windows, I want to load a monochrome bitmap resource and use it as a texture for alpha values. I’m having the following problem with this: the bitmap resource, since it is a monochrome bitmap, is packed such that each bit corresponds to a single pixel. Basically, my bitmap is 64x64 pixels, for a total of 4096 pixels. Since there is only 1 bit per pixel, the bitmap consists of only 512 bytes (4096 pixels, 8 pixels in each byte). How do I tell OpenGL that my bitmap is packed in this way?
I tried using a couple of glPixelStore* settings that I thought were correct, but didn’t have success. My tex image 2D call looks like:
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 64, 64, 0, GL_ALPHA, GL_BITMAP, pBitmapBits);
Any ideas?