Suggestion: Inline OpenGL Code

Hello,
One of the coolest features of another programing environment I use to use (BlitzMax) was that you could write OpenGL code right inside the script. So, for instance, you could write:


GLGraphics 640,480

While Not KeyHit( KEY_ESCAPE )

	glClear GL_COLOR_BUFFER_BIT

	glBegin GL_TRIANGLES
	glVertex2i 0,1
	glVertex2i 1,-1
	glVertex2i -1,-1
	glEnd

	Flip

Wend

While shaders are useful, they can’t do everything (easily). We still have to create a mesh to do everything with them. With this, we could write almost any graphic effect without meshes whenever we wanted to.
Thanks!

@Zoyt: The API you describe there is OpenGL’s immediate mode. This API (glBegin/end) has been deprecated for quite some time and has never been available mobile versions of OpenGL ES.

The primary way to draw vertex data in current versions of OpenGL is glDrawArrays / glDrawElements. I think you will find that the mesh API is significantly nicer than those two functions. (For reference, you can see the APIs here: http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml and http://www.opengl.org/sdk/docs/man/xhtml/glDrawArrays.xml )