Original Post
I have this code for my textures but if I use 30 textures at once then the computer runs out of memory, or says DIB convertion error or something! I was wondering if there was a better way or some code to stop this? Code below! Thanks for any help in advance!
GLuint LoadTexture(char *filename) {
GLuint texID;
AUX_RGBImageRec *image = auxDIBImageLoad(filename);
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_2D, texID);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->sizeX, image->sizeY, GL_RGB, GL_UNSIGNED_BYTE, image->data);
return texID;
}
static void background(){
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, LoadTexture("water.bmp"));
glBegin(GL_QUADS);
glColor3f(1,1,1);
glTexCoord2f(10.0f, 10.0f); glVertex2d(winL,winT);
glTexCoord2f(10.0f, 0.0f); glVertex2d(winL,winB);
glTexCoord2f(0.0f, 0.0f); glVertex2d(winR,winB);
glTexCoord2f(0.0f, 10.0f); glVertex2d(winR,winT);
glEnd();
}