Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>My drawing looks like:</p> <pre><code>glBindTexture(GL_TEXTURE_2D, tex-&gt;name); // bind to the name glVertexPointer(3, GL_FLOAT, 0, vertices); // verices is the alignment in triangles glTexCoordPointer(2, GL_FLOAT, 0, coordinates); // coordinates describes the rectangle glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //draw </code></pre> <p>It's hard to know what you can remove without knowing exactly what you're trying to do.</p> <p><strong>edit:</strong></p> <p>Unless you are disabling blend at some point, you can get rid of all of the blend calls:</p> <pre><code>glEnable(GL_BLEND); glBlendFunc... </code></pre> <p>Put them in the initialization of your GL state if you need to set it once. If you need to enable and disable it is better to set the state once for everything you need to draw blended and then set the state again (once) for the unblended.</p> <p>OpenGL is a <a href="http://en.wikipedia.org/wiki/State_machine" rel="nofollow noreferrer">state machine</a> so this general idea applies anywhere you need to change the GL state (like setting texture environment with glTexEnvf).</p> <p>About state machines:</p> <blockquote> <p>A current state is determined by past states of the system. As such, it can be said to record information about the past, i.e., it reflects the input changes from the system start to the present moment. A transition indicates a state change and is described by a condition that would need to be fulfilled to enable the transition.</p> </blockquote>
 

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