glGenTextures:
PARAMETERS
n Specifies the number of texture names to be
generated.
textures Specifies an array in which the generated texture
names are stored.
glGenTextures(texsiz, &texture[0]); // Create The Texture
Don't you mean, create the Textures
Looks like you're passing the address of a specific texture ID in the texture ID array...(which still is technically an array, and why it compiles)...
Try passing &texture instead.
EDIT: Course I am working blindly, so that might not be it.
Here is my loadgltexture function that I modified in the past,
I'm really perplexed as to how this works myself.
If a gluint is nothing but a dword, what good is returning it?
Code:
GLuint LoadGLTexture( const char *filename ) // Load Bitmaps And Convert To Textures
{
AUX_RGBImageRec *pImage; // Create Storage Space For The Texture
GLuint texture = 0; // Texture ID
pImage = LoadBMP( filename ); // Loads The Bitmap Specified By filename
// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit
if ( pImage != NULL && pImage->data != NULL ) // If Texture Image Exists
{
glGenTextures(1, &texture); // Create The Texture
// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, 3, pImage->sizeX, pImage->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
free(pImage->data); // Free The Texture Image Memory
free(pImage); // Free The Image Structure
}
return texture; // Return The Status
}
This stuff is weird.
Code:
glGenTextures(1, &texture); // Create The Texture
Parameter 2 is supposed to be a pointer or reference to pointer of an array in which the generated names are stored]
Whats odd here, is that it's allowing me to pass a gluint in replacement of this array of texture id's. A gluint can be a texture ID I suppose but it's not a texture ID array. My LoadGLTextures function only does 1 texture at a time, thats why I use a GLuint as the parameter for the pointer to the container of texture id's.
So it sounds like to me an array of gluint's should suffice as a paramter, you're still passing it a single gluint though here: (which is why you're only loading 1 texture)
Code:
glGenTextures(/*parameter for number of textures*/, /*parameter for array of tex id's*/); // Create The Textures
First off, parameter 1 is a number, simply that; the number of textures you are loading.
For the first parameter, try manually entering 2 as the number of textures.