Original Post
I can''t figure out why glTexImage2D is skipping two bytes in this 16 byte array.
I can see there is no problem initializing the array in the debugger.
Any Ideas?
glGenTextures(1, &arid[10]);
glBindTexture(GL_TEXTURE_2D, arid[10]);
unsigned char b2[2][2][3];
//pixel 1
b2[0][0][0] = 255;
b2[0][0][1] = 255;
b2[0][0][2] = 255;
//pixel 2
b2[0][1][0] = 255;
b2[0][1][1] = 255;
b2[0][1][2] = 255;
//pixel 3
b2[1][0][0] = 255; //it skips these two bytes
b2[1][0][1] = 255; //it skips these two bytes
b2[1][0][2] = 255; //now pixel 3 starts here and takes from pixel 4
//pixel 4
b2[1][1][0] = 255;
b2[1][1][1] = 255;
b2[1][1][2] = 255;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, b2);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);