title: glTexCoord2d has no effect
body: <p>I'm trying to draw a simple texture in opengl. I made a simple class Texture:</p>
  
  <pre><code>class Texture{
  public:
      unsigned int id;
      unsigned char image[256*256*3];
      int level;
      int border;
      int width;
      int height;    
  
      Texture (int level =0, int border = 0) : level(level), border(border) {
          glGenTextures(1, &amp;id);
          width = 256, height = 256;
          glTexImage2D(GL_TEXTURE_2D, level, GL_RGB, width, height, border, GL_RGB, GL_UNSIGNED_BYTE, &amp;image[0]);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
          glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); 
  
  
          for (int i= 0; i&lt;width*height*3; i+=3){
              image[i]=1;//i%255;
              image[i+1] =1;// 255-i%255;
              image[i+2] =1;// i%128;
          }
      }
  
      void useIt(){
          glBindTexture( GL_TEXTURE_2D, id );
      }
  };
  </code></pre>
  
  <p>It creates an unsigned char array and fill it with some random data. I'm trying to use it this way:</p>
  
  <pre><code>glEnable(GL_TEXTURE_2D);
  texture-&gt;useIt();
  glBegin(GL_TRIANGLES);
  
  glNormal3d(0, 1, 0);
  glTexCoord2d(0.0,0.0);
  glVertex3f(width/-2.f,height/2.f,depth/2.f);
  glTexCoord2d(1.0,1.0);  
  glVertex3f(width/2.f,height/2.f,depth/2.f);
  glTexCoord2d(1.0,0.0);
  glVertex3f(width/2.f,height/2.f,depth/-2.f);
  glTexCoord2d(0.0,0.0);
  glVertex3f(width/-2.f,height/2.f,depth/2.f);
  glTexCoord2d(1.0,1.0);
  glVertex3f(width/2.f,height/2.f,depth/-2.f);
  glTexCoord2d(0.0,1.0);
  glVertex3f(width/-2.f,height/2.f,depth/-2.f);
  
  glEnd();
  glDisable(GL_TEXTURE_2D);
  </code></pre>
  
  <p>It draws the plane, but withouht texture (draws with the previously used material). what am i doing wrong?</p>