PDA

View Full Version : Drawing bitmaps



02-25-2001, 10:58 AM
The following code should draw a bitmap of a letter 'A' but it does not work. What is wrong with this code?

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

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glRasterPos2i(20, 60);
glColor3f(1, 1, 1);
glBitmap(8, 13, 0.0, 0.0, 0.0, 0.0, A[0]);

Deiussum
02-25-2001, 03:56 PM
Not knowing what your projection matrix is like, I'd have to guess that you are setting the raster position outside of the window. The raster position is not based on window coordinates but on the coordinates of the scene.