Assume I have GL_TEXTURE_2D_ARRAY including 6 textures I'm loading it with:
vector<string>::iterator vsit;
for(vsit=filenameTable.begin();vsit!=filenameTable.end();++vsit)
{
string filename = *vsit;
BMPData* bmpData = LoadTextureBMPData_custom(filename);
glTexSubImage3D(GL_TEXTURE_2D_ARRAY,0,0,0,i++,bmpData->width,bmpData->height,1,GL_BGR,GL_UNSIGNED_BYTE,(GLvoid*)&(bmpData->data[0]));
}
Before this code I have to allocate storage for every texture, if I have good understand I can do this with glTexImage3D() or glTexStorage3D(), for example:
glTexImage3D(GL_TEXTURE_2D_ARRAY,0,GL_RGB,1024,1024,filenameTable.size(),0,GL_BGR,GL_UNSIGNED_BYTE,NULL);
or
glTexStorage3D(GL_TEXTURE_2D_ARRAY,0,GL_RGB,1024,1024,filenameTable.size());
================================================================================ But when I allocate size for every texture in table I have only one pair of parameters for [width,height] of texture. What if I want every texture image to have another dimmensions? Is there any solution for this problem without scaling every texture to one size in graphic editor?
Another problem is fact that glTexStorage3D() I'm presenting on third code snipper causing crash of my program. Information about glTexStorage3D() I found there:
http://www.opengl.org/wiki/Array_Texture