What does Flip really do?

BlitzMax Forums/BlitzMax Programming/What does Flip really do?

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Here's the GL code for DrawRect in glmax2d.bmx:

		glBegin GL_QUADS
		glVertex2f x0*ix+y0*iy+tx,x0*jx+y0*jy+ty
		glVertex2f x1*ix+y0*iy+tx,x1*jx+y0*jy+ty
		glVertex2f x1*ix+y1*iy+tx,x1*jx+y1*jy+ty
		glVertex2f x0*ix+y1*iy+tx,x0*jx+y1*jy+ty
		glEnd

As you can see only the single quad is drawn inbetween glBegin and glEnd. If you were to fit more glVertex commands in there you could get a speed gain.

Using vertex arrays would offer another speed gain, replacing all the glVertex calls with a single pointer to an array.