A little gl help required

BlitzMax Forums/BlitzMax OpenGL Programming/A little gl help required

I'm a bit of a noob when it comes to this openGL stuff, so with that in mind could you tell me why this doesn't do anything. it should draw a spiral of points.

(codebox)
Graphics 640,480,0,32

glMatrixMode(gl_PROJECTION)
glLoadIdentity()
glClearColor(0.0,0.0,0.0,1.0)
glColor3f(0.0,1.0,0.0)

Local x#,y#,z#,angle#

While Not KeyHit(key_escape)
glClear(GL_COLOR_BUFFER_BIT)

glPushMatrix()

glRotatef(xRot,1.0,0.0,0.0)
glRotatef(yRot,0.0,1.0,0.0)

z=-50.0
glBegin(GL_POINTS)

For angle=0.0 To (2.0*Pi)*3.0 Step 0.1
x=50.0*Sin(angle)
y=50.0*Cos(angle)

glVertex3f(x,y,z)
z:+0.5
Next

glEnd()

glPopMatrix()

glSwapBuffers()

glFlush()

Flip
Wend
(/codebox)

this is just a guess (so apologies if i'm wrong), but wouldn't you need to specify the gl driver before you do graphics?

Use GLGraphics instead of Graphics. That does what dan says, just in one line, not 2 :)

It should still work with Max2D gl graphics driver.

Also I don't think you should use glSwapBuffers(), just use Flip()

You muste use the GL Modelview Matrix to transform objects in the worldspace.

cu olli