#include once "FBTinyGL.bi" ' test of glArrayElement dim as integer scr_w = 640 dim as integer scr_h = 480 dim as integer scr_b = 16 screenres scr_w,scr_h,scr_b ' if we are in palette mode 224 is white if scr_b<15 then color 224 var ctx = CreateRenderContext() ' minimal OpenGL init glViewport(0,0, scr_w, scr_h) glMatrixMode(GL_PROJECTION) gluPerspective(45.0, scr_w/scr_h, 0.1, 100.0) glMatrixMode(GL_MODELVIEW) glClearColor(0,.5,.5) dim as single vertices(...) => { _ -1, 1, -1, _ -1,-1, -1, _ 1,-1, -1, _ 1, 1, -1} dim as single colors(...) => { _ 0, 0, 0, _ 0, 0, 1, _ 0, 1, 0, _ 0, 1, 1} dim as long edgeflags(...) => { _ 1,0,1,0 } glVertexPointer (3, GL_FLOAT, 0, @vertices(0)) glColorPointer (3, GL_FLOAT, 0, @colors(0)) glEdgeFlagPointer( 0, @edgeflags(0)) glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_COLOR_ARRAY) glEnableClientState(GL_EDGE_FLAG_ARRAY) glTranslatef(0,0,-3) dim as integer frames,n dim as long mode=GL_LINE while inkey()="" if (frames mod 4)=0 then if mode=GL_LINE then mode=GL_FILL elseif mode=GL_FILL then mode=GL_POINT else mode=GL_LINE end if glPolygonMode(GL_FRONT_AND_BACK,mode) end if glClear(GL_COLOR_BUFFER_BIT) glBegin(GL_TRIANGLES) for i as integer=1 to 3 glArrayElement(n) : n=(n+1) mod 4 next glEnd() SwapBuffers(ctx,true) frames+=1 sleep 500 wend DestroyRenderContext(ctx)