title: Why I get a 1282 error after glLoadIdentity() is invoked?
body: <p><strong>CODE:</strong>  </p>
  
  <pre><code> int err = glGetError();  // err = 0
  
   glMatrixMode(GL_TEXTURE);
   err = glGetError();      // err = 0
  
   glLoadIdentity();
   err = glGetError();      // err = 1282
  </code></pre>
  
  <p><strong>GL_INVALID_OPERATION</strong><br>
  The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag.  </p>
  
  <p>I use gDEBugger to check openGL's state when I get the error. </p>
  
  <pre><code>GL_CURRENT_RASTER_POSITION_VALID=TRUE
  GL_CURRENT_RASTER_TEXTURE_COORDS=N/A
  GL_CURRENT_TEXTURE_COORDS=N/A
  GL_PROJECTION_STACK_DEPTH=1
  GL_TEXTURE_1D=FALSE
  GL_TEXTURE_2D=FALSE
  GL_TEXTURE_GEN_Q=N/A
  GL_TEXTURE_GEN_R=N/A
  GL_TEXTURE_GEN_S=N/A
  GL_TEXTURE_GEN_T=N/A
  GL_TEXTURE_MATRIX=N/A
  GL_TEXTURE_STACK_DEPTH=N/A
  GL_TEXTURE_BINDING_1D=0
  GL_TEXTURE_BINDING_2D=0
  GL_TEXTURE_BINDING_3D=0
  GL_TEXTURE_ENV_MODE=GL_MODULATE
  GL_TEXTURE_ENV_COLOR={0, 0, 0, 0}
  GL_ACTIVE_TEXTURE=GL_TEXTURE11
  GL_CLIENT_ACTIVE_TEXTURE=GL_TEXTURE0
  GL_MAX_TEXTURE_UNITS=4
  GL_ACTIVE_TEXTURE_ARB=GL_TEXTURE11
  GL_CLIENT_ACTIVE_TEXTURE_ARB=GL_TEXTURE0
  GL_MAX_TEXTURE_UNITS_ARB=4
  </code></pre>
  
  <p>I can not figure out where is wrong. Why not the simply operation can not be allowed?</p>