title: glActiveTexture() throws GL_INVALID_ENUM
body: <p>The  line</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE0+32);
  </code></pre>
  
  <p>throws GL_INVALID_ENUM (as I found running glGetError()), while</p>
  
  <pre><code>glActiveTexture(GL_TEXTURE0+31);
  </code></pre>
  
  <p>runs fine. </p>
  
  <p>According to <a href="http://www.opengl.org/sdk/docs/man/docbook4/xhtml/glActiveTexture.xml" rel="nofollow">the documentation</a>:</p>
  
  <blockquote>
    <p>"GL_INVALID_ENUM is generated if texture is not one of GL_TEXTUREi, where i ranges from zero to the value of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS minus one."</p>
  </blockquote>
  
  <p>but in my case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS is defined as 35661, and according to the same documentation</p>
  
  <blockquote>
    <p>"The number of texture units is implementation dependent, but must be at least 80."</p>
  </blockquote>
  
  <p>How could I solve this problem?</p>
  
  <p>Just in case, GL_TEXTURE0 is defined as 33984 and my version of OpenGL is 2.1</p>