   Multitexturing Problem
  I have linux box with debian unstable, 2.6.0 kernel and nvidia 5200fx with latest drivers.  So, I tried to make a simple multitexturing test program using opengl and it only shows the first texture (the one in GL_TEXTURE0_ARB).  I know it is not the texture loading or anything like that because if I switch the textures the other one shows up.  OpenGL reports that I have 4 texture units, and I''ve looked at all the examples on the web and I cannot see what I am doing wrong.  So here it is.  Thanks in advance for all your help.   void display( void ){... //glClear + viewport and all that stuffglActiveTextureARB( GL_TEXTURE0_ARB );glEnable( GL_TEXTURE_2D );glBindTexture( GL_TEXTURE_2D, i1 );glActiveTextureARB( GL_TEXTURE1_ARB );glEnable( GL_TEXTURE_2D );glBindTexture( GL_TEXTURE_2D, i2 );glBegin( GL_QUADS );glNormal3f( 0.0, 0.0, 1.0 );glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 0.0, 1.0 );glMultiTexCoord2fARB( GL_TEXUTRE1_ARB, 0.0, 1.0 );glVertex3f( -2.0, 2.0, -10.0 );glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 1.0, 1.0 );glMultiTexCoord2fARB( GL_TEXUTRE1_ARB, 1.0, 1.0 );glVertex3f( 2.0, 2.0, -10.0 );glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 1.0, 0.0 );glMultiTexCoord2fARB( GL_TEXUTRE1_ARB, 1.0, 0.0 );glVertex3f( 2.0, -2.0, -10.0 );glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 0.0, 0.0 );glMultiTexCoord2fARB( GL_TEXUTRE1_ARB, 0.0, 0.0 );glVertex3f( -2.0, -2.0, -10.0 );glEnd();}
  Everything there looks fine. Can you post the code where you setup your texture parameters, image, and environment? ;  Did you initialize the glActiveTexture, glMultiTexCoord2f, ect...  pointer functions?  Because, correct me if I''m wrong, you have to manually set what these functions point to.  For instance, in windows, this is what I have to do://Declare these variablesPFNGLACTIVETEXTUREARBPROC  glActiveTextureARB  = NULL;PFNGLMULTITEXCOORD2FARBPROCglMultiTexCoord2fARB= NULL;//Put this code in some functionglActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress("glMultiTexCoord2fARB");This should work.  I know in windows if I don''t do this, my program actually crashes.  Maybe its different in Linux.  Good luck!GO LINUX !!!!When is Mac OSX gonna take over the desktop? ;  here's the texture loading part.  The textures are png files loaded with my minimally functional game engine that in turn calls libpng. void initGL( void ){glClearColor( .4, .4, .4, 1.0 );glEnable( GL_DEPTH_TEST );glEnable( GL_LIGHTING );glEnable( GL_LIGHT0 );glEnable( GL_TEXTURE_2D );image = new xImage_PNG( "./test.png" ); //my texture loading code which should work.image2 = new xImage_PNG( "./light.png" );glGenTextures( 1, &i1 );glGenTextures( 1, &i2 );glBindTexture( GL_TEXTURE_2D, i1 );glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, image->getWidth(), image->getHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, image->getData() );glBindTexture( GL_TEXTURE_2D, i2 );glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, image2->getWidth(), image2->getHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, image2->getData() );}as for the wgl proc calls, I thought that was only windows.   [edited by - tim1661 on February 17, 2004 6:18:52 PM]