Original Post
Im loading a texture into a GLbyte array the code for that is:
int index = 0;
for( int i = 0; i < h; i++ )
{
int k = 0;
for( int j = 0; j < w; j+=4 )
{
tmp = texture.GetPixel( i, k );
img[index + 0] = tmp.r;
img[index + 1] = tmp.g;
img[index + 2] = tmp.b;
img[index + 3] = tmp.alpha;
index += 4;
k++;
}
}
when I get to glTexImage2D I get an access error, im not sure why, the only reason that i can think of is that im loading it into the array incorrectly...my call to glTexImage2D looks like:
glTexImage2D( GL_TEXTURE_2D, 0, 4, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, img );
any ideas? also if someone can tell me how to post code blocks that would be helpful : )