After a few days of head scratching, finally got this baby up and running..
Here's a small example that might come in useful:
bglCreateContext(800,600,32,0,BGL_BACKBUFFER|BGL_DEPTHBUFFER|BGL_FULLSCREEN)
glClearColor(0.0, 0.0, 0.0, 0.0)
glColor3f(0.0, 0.0, 1.0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45.0, 800/600, 0.1, 100.0)
glewInit
Global data:Float[]=[ 0.0, 1.0,-10.0,-1.0,-1.0,-10.0,1.0,-1.0,-10.0 ]
Global buffer:Int = 0
Global sglfloat:Int = Sizeof(GL_FLOAT)
glEnableClientState(GL_VERTEX_ARRAY)
glGenBuffersARB(1, Varptr(buffer))
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer)
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sglfloat*Sizeof(data), data, GL_STATIC_DRAW_ARB)
While Not KeyDown(KEY_ESCAPE)
glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
glEnableClientState(GL_VERTEX_ARRAY)
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer)
glVertexPointer(3, GL_FLOAT, 0, Int Ptr 0)
glDrawArrays(GL_TRIANGLES, 0, 3)
FlushMem
bglSwapBuffers
Wend
End
What is it ?, and why do you need it ??
The vertex data is stored in the graphics card memory, rather than the systems - (which is transfered across every time its used). Huge speedups can be had.. the only downside being its quite a new command, so some of the older graphics cards might not be able to support it.