   Objects not textured
  [updated to include the new code]i'm currently working on a texture manager.. i can load the bitmap (and other formats) fine, but when i have loaded a bitmap (for eg) i don;t actually get a texture mapped object. I'm obviously missing something but I can;t see it. I've checked it over and over... here's the texture gen code:   glEnable (GL_TEXTURE_2D);  if ( !(bitmap->loadBitmap (file_name)) )   {MessageBox(g_hwnd, "Unable to load BMP File!", "Error", MB_OK);return 0;   } glGenTextures(1, m_tex_ID);   glBindTexture (GL_TEXTURE_2D, m_tex_ID[0]);   temp_data.texture_ID = m_tex_ID[0];   temp_data.texture_name = strdup (ref_name);   m_texture_list.push_back (temp_data);   glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);   glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR); glTexImage2D (GL_TEXTURE_2D,  0,  3,  bitmap->m_width,  bitmap->m_height,  0,  GL_RGB,  GL_UNSIGNED_BYTE,  bitmap->m_imageData); delete (bitmap);and when i try to apply it (in another function not part of this class)glColor3f (0.0f, 0.0f, 1.0f);  glEnable(GL_TEXTURE_2D);  tex_manager->bindTexture ("first");  glBegin (GL_QUADS);  glTexCoord2f(0.0f, 1.0f);  glVertex3f (-10.0f, 0.0f, -10.0f);  glTexCoord2f(1.0f, 1.0f);  glVertex3f (10.0f, 0.0f, -10.0f);  glTexCoord2f(1.0f, 0.0f);  glVertex3f (10.0f, 0.0f, 10.0f);  glTexCoord2f(0.0f, 0.0f);  glVertex3f (-10.0f, 0.0f, 10.0f);  glEnd ();  glDisable (GL_TEXTURE_2D);and the call to tex_manager->bindTexture ("first"); searches for the names texture in the list and binds it (I know that the correct texture is binded).I've tried 64x64, 128x128 and 256x256 textures... no joy...thanks in advance...   -----------------------"Without a sense of humour we couldn't react to a lot of things"[edited by - jhavna on July 30, 2003 4:49:06 AM][edited by - jhavna on July 30, 2003 4:49:33 AM]
  Are you sure that the texture coordinates are right?  The first time I tried to do that the texture came out all distorted, and that was why. ;  yes, they should be fine.. i checked them over and over...   -----------------------"Without a sense of humour we couldn''t react to a lot of things" ;  That code for a texture loader never actually uploads the texture data into VRAM. In fact the only thing you do with the bitmap file is load and then delete it. ;  ok, so i addglTexImage2D (GL_TEXTURE_2D,  0,  GL_RGB,  bitmap->m_width,  bitmap->m_height,  0,  GL_RGB,  GL_UNSIGNED_BYTE,  bitmap->m_imageData);  yet still no results. To double check, i plotted the bitmap with glDrawPixels and it''s fine, so there must be something missing in the texture creation/assignment...   -----------------------"Without a sense of humour we couldn''t react to a lot of things" ;  did you glEnable(GL_TEXTURE_2D) before loading the texture?are the texture sizes power of 2?just some thoughts... ;  Yep, i set glEnable(GL_TEXTURE_2D) before i load the bitmap and all that, and the texture is 256x256 (i also tried 128x128)still no joy.. i''ll keep plugging awaythanks so far...   -----------------------"Without a sense of humour we couldn''t react to a lot of things" ;  well, i finally pin pointed it:i changedglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);  toto glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);  and i got a texture mapped quad... does certain HW not support what i was trying to do?   -----------------------"Without a sense of humour we couldn''t react to a lot of things" ;  You cannot request for a mipmaped filter when you dont have any mipmap images in the texture..;  I''ve got the same problem, although I''ve had it set to GL_LINEAR since the beginning and it still doesn''t display any textures, just plain white ploygons.  I''ve posted my code here. 