PDA

View Full Version : Image Blitting



jacob_ewing
09-12-2001, 03:50 PM
What I would like to do is take a simple array of RGB values (eg. "unsigned char image[xsize * ysize * 3];")
and be able to copy it directly on the screen.

Is there a simple way of doing this? I tried doing so using glDrawPixels but to no avail - I don't quite understand what format the data needs to be in.

Thanks in advance

john
09-12-2001, 04:23 PM
glDrawpixels will work with your data.

(the type is GL_UNSIGNED_BYTE and your format is GL_RGB).

cheers,
John

Gavin
09-13-2001, 12:42 AM
GLUbyte *data;

/* data = malloc..... */

glDrawPixels(......, data);