
confused
hey,
i have this little problem: i load a number of textures. the number of textures varies as it''s read from a file. so are the texture names. what i need to do is create an array of AUX_RGBImageRec * ''s as an array of pointers. what confuses me is the declaration syntax. so far i''ve come up with the following code:
#define NUM_TEXTURES 1024
AUX_RGBImageRec * TextureImage[NUM_TEXTURES]; // 1)
GLuint Texture[NUM_TEXTURES];
/////////
numTextures = 42; //e g this many textures are required to be loaded
/////////
for(...)
{
TextureImage = new(AUX_RGBImageRec); // 2)
}
memset(TextureImage, 0, sizeof(void *) * numTextures);
glGenTextures(numTextures, &Texture[0]);
for(...)
{
//load all the files and create the textures
}
binding a texture from the list after it is loaded, however, doesn''t work as expected. i think it only loads one texture - i think it''s the first one only. my guess is something is wrong with the lines commented with 1) and 2)... how should i declare and allocate memory for an array of pointers to pointers to objects (AUX_RGBImageRec in this case)?
thanks and keep cool
!

January 10, 2002 05:19 PM
this is what i did
|
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement