Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>glBegin</code> must come after your texture binding functions in <code>Draw</code>:</p> <pre><code>glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glBindTexture(GL_TEXTURE_2D, textureID); glBegin(GL_QUADS); </code></pre> <p>In the documentation for <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindTexture.xml" rel="nofollow">glBindTexture</a> it states:</p> <blockquote> <p>When a texture is bound to a target, the previous binding for that target is automatically broken.</p> </blockquote> <p>You'll also find that in the documentation for <a href="http://www.opengl.org/sdk/docs/man2/xhtml/glBegin.xml" rel="nofollow">glBegin</a> it states:</p> <blockquote> <p>Only a subset of GL commands can be used between <code>glBegin</code> and <code>glEnd</code>. The commands are <code>glVertex</code>, <code>glColor</code>, <code>glSecondaryColor</code>, <code>glIndex</code>, <code>glNormal</code>, <code>glFogCoord</code>, <code>glTexCoord</code>, <code>glMultiTexCoord</code>, <code>glVertexAttrib</code>, <code>glEvalCoord</code>, <code>glEvalPoint</code>, <code>glArrayElement</code>, <code>glMaterial</code>, and <code>glEdgeFlag</code>. Also, it is acceptable to use <code>glCallList</code> or <code>glCallLists</code> to execute display lists that include only the preceding commands. If any other GL command is executed between <code>glBegin</code> and <code>glEnd</code>, the error flag is set and the command is ignored.</p> </blockquote> <p>Because of this, in your <code>Draw</code> function, you're going to need to place <code>glBindTexture(GL_TEXTURE_2D, textureID);</code> and <code>glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);</code> before <code>glBegin(GL_QUADS)</code>. Otherwise, <code>glBindTexture</code> does nothing because it's within a <code>glBegin</code> and therefore <code>SecondBMP.bmp</code> is still bound to the target <code>GL_TEXTURE_2D</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload