Skip to content

Instantly share code, notes, and snippets.

@JonRurka
Created January 3, 2015 04:10
Show Gist options
  • Save JonRurka/097158ec088c12153af4 to your computer and use it in GitHub Desktop.
Save JonRurka/097158ec088c12153af4 to your computer and use it in GitHub Desktop.
public void flush()
{
this.vertexBuffer.flip();
this.texCoordBuffer.flip();
this.colorBuffer.flip();
GL11.glVertexPointer(3, 0, this.vertexBuffer);
if (this.hasTexture) {
GL11.glTexCoordPointer(2, 0, this.texCoordBuffer);
}
if (this.hasColor) {
GL11.glColorPointer(3, 0, this.colorBuffer);
}
GL11.glEnableClientState(32884);
if (this.hasTexture) {
GL11.glEnableClientState(32888);
}
if (this.hasColor) {
GL11.glEnableClientState(32886);
}
GL11.glDrawArrays(7, 0, this.vertices);
GL11.glDisableClientState(32884);
if (this.hasTexture) {
GL11.glDisableClientState(32888);
}
if (this.hasColor) {
GL11.glDisableClientState(32886);
}
clear();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment