   glGenTextures question
  glGenTextures doesn''t seem to put the texture number in holder. What am i doing wrong?Thanx, MartyPS: This is the source:   GLuint LoadTexture(char *filename){static GLuint holder;AUX_RGBImageRec *TextureImage[1];// storagespace for 1 texturememset(TextureImage,0,sizeof(void *)*1);// clear the memif (TextureImage[0] = LoadBMP(filename))// load the file{glGenTextures(1, &holder);// create space for textureglPixelStorei (GL_UNPACK_ALIGNMENT, 1);glBindTexture(GL_TEXTURE_2D, holder);// bind the loaded textureglTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); // set paramsglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // set paramsgluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);if (TextureImage[0]){if (TextureImage[0]->data) {free(TextureImage[0]->data);// free the loaded bmp}free(TextureImage[0]);// and the memory}}else{MessageBox(NULL, filename, "Error loading file", MB_OK);exit(0);}return holder;}
  Are you calling this code before you have a valid OpenGL context?Enigma ;  yes. I''m using glut... I do call it before opening the context, because I give feedback in the same window as glut is going to use. I did glEnable(GL_TEXTURE_2D). Isn''t that enough?Thanx,Marty ;  You have to create a window and set up a context before you do any Opengl calls ;  You have to have a valid context before you start calling OpenGL commands.  With glut I think the context is created when you make the glutCreateWindow call, so just call your OpenGL initialisation after that.Enigma 