PDA

View Full Version : bitmap as a raster pic



fortikur
06-13-2004, 12:33 AM
How can I display a 24 bit rgba bitmap (using alpha channel) on the screen using raster coordinates?
I already got a code like that:

GLubyte A[1][13] = { {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18}};

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glRasterPos2i(x_pos, y_pos);
glColor3f(1, 1, 1);
glBitmap(8, 13, 0.0, 0.0, 0.0, 0.0, A[0]);

but I'm not sure how to use a 24 bit bitmap instead of a b/w bitmap...
Can anyone help me?

06-13-2004, 12:39 AM
How can I display a 24 bit rgba bitmap (using alpha channel) on the screen using raster coordinates?not sure i understand you, using alpha channel?maybe you want to use glDrawPixels() to draw a color image instead? or a quad and a texture?
:confused:

fortikur
06-13-2004, 04:38 AM
I want to display an image, like the text in the NeHe examples. I need alpha channel, because I want to have pixels, wich are transparent.
If I used a quad without depth check, I would have only 3d space coordinates, but no screen coords. Like a background for example.
The only problen with DrawPixels is, that it is slow.
So, the solution would be the quad with a texture with a dimension given in screen coords, like putimage() was in BGI, or blit() in Allegro, etc.

06-13-2004, 05:23 PM
So, the solution would be the quad with a texture with a dimension given in screen coords, like putimage() was in BGI, or blit() in Allegro, etc.i concur. textured quads are great for text.