title: GlGenTextures keeps returing 0's
body: <p>I'm trying to generate textures like so:</p>
  
  <pre><code>#define checkImageWidth 64
  #define checkImageHeight 64
  static GLubyte checkImage[checkImageHeight][checkImageWidth][4];
  static GLubyte otherImage[checkImageHeight][checkImageWidth][4];
  
  static GLuint texName[2];
  
  void makeCheckImages(void)
  {
      int i, j, c;
  
      for (i = 0; i &lt; checkImageHeight; i++) {
          for (j = 0; j &lt; checkImageWidth; j++) {
              c = ((((i&amp;0x8)==0)^((j&amp;0x8))==0))*255;
              checkImage[i][j][0] = (GLubyte) c;
              checkImage[i][j][1] = (GLubyte) c;
              checkImage[i][j][2] = (GLubyte) c;
              checkImage[i][j][3] = (GLubyte) 255;
              c = ((((i&amp;0x10)==0)^((j&amp;0x10))==0))*255;
              otherImage[i][j][0] = (GLubyte) c;
              otherImage[i][j][1] = (GLubyte) 0;
              otherImage[i][j][2] = (GLubyte) 0;
              otherImage[i][j][3] = (GLubyte) 255;
          }
      }
  }
  void init(void)
  {    
      glClearColor (1.0, 0.0, 0.0, 0.0);
      glShadeModel(GL_FLAT);
      glEnable(GL_DEPTH_TEST);
  
      makeCheckImages();
      glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  
      glGenTextures(2, texName);
      glBindTexture(GL_TEXTURE_2D, texName[0]);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
          GL_NEAREST);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
          GL_NEAREST);
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
          checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
          checkImage);
  
      glBindTexture(GL_TEXTURE_2D, texName[1]);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
          GL_NEAREST);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
          GL_NEAREST);
      glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);   
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth, 
          checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 
          otherImage);
      glEnable(GL_TEXTURE_2D);
  
      engineGL.current.tex = texName[1];
  }
  </code></pre>
  
  <p>But when I check the values of texName[0] and [1] they are both 0, I do not understand why, what am I doing wrong. Thanks.</p>