Original Post
hello, i need some help to understand how i can convert my generated image into an unsigned char array that i need for "gluBuild2DMipmaps()" function. the code i wrote to generate the image: short iSize = 128; int x, y; unsigned char data[128][128][4]; for ( x = 0; x < iSize; x++ ) { for ( y = 0; y < iSize; y++ ) { int c = ((((x&0x20)==0)^((y&0x20))==0)); c = c ? 255 : 128; data[x][y][0] = c; data[x][y][1] = c; data[x][y][2] = c; data[x][y][3] = 255; } } unsigned char *imageDATA; // this will eventually become the image data. could anyone help me with this, i dont know how the pixel offset for image data works. Thanks, [Edited by - menorian on April 12, 2009 6:53:03 PM]
