title: How to apply texture to glutSolidCube
body: <p>I can find tutorials about mapping textures to polygons specifying vertices etc. but nothing regarding how to apply a texture to a cube (or other stuff) drawn with glut (glutSolidCube).</p>
  
  <p>I am doing something like:</p>
  
  <pre><code>glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, decal);
  glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, repeat);
  glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, repeat);
  glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nearest);
  glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, nearest);
  
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glTexImage2D(GL_TEXTURE_2D, 0, 4, myImageWidth, myImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)myImage);
  
  //...
  
  glEnable(GL_TEXTURE_2D);
  
  //now draw the cube
  glutSolidCube(N);
  </code></pre>
  
  <p>Doing this I get the texture to apply to the cube but the whole cube gets the color of the first byte in the texture!</p>
  
  <p>Is there any way of mapping a texture to a solid cube (and other solids) when using glutSolidCube?</p>