Ok, so I have the following code:
Import brl.BlitzGL
Import pub.OpenGL
bglCreateContext 800,600,16,0,BGL_BACKBUFFER | BGL_DEPTHBUFFER
glShadeModel GL_SMOOTH
glClearColor 0.0,0.0,0.0,0.0
val = 0
While Not KeyDown(KEY_ESCAPE)
glMatrixMode GL_PROJECTION
glLoadIdentity
gluPerspective 45,800/600,0.1,100
glMatrixMode GL_MODELVIEW
glLoadIdentity
glClearDepth 0.0
glViewPort 0,0,800,600
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glRotatef val,0,0,0
val = val + 1
glBegin GL_QUADS
glVertex2f -1,1
glVertex2f 1,1
glVertex2f 1,-1
glVertex2f -1,-1
glEnd
FlushMem
bglSwapBuffers
Wend
End
But it seems to produce a blank window. Further, when I previously tried it without the rotation, it did produce a quad but it was rectangular rather than square, suggesting that the aspect ratio was wrong.
I've tried re-arranging all of the initialisation stuff several times and copying the order out of the OpenGL example included with blitzMax but it still refuses to show anything. Can anyone give me a clue what's going on?
Import brl.BlitzGL
Import pub.OpenGL
bglCreateContext 800,600,16,0,BGL_BACKBUFFER | BGL_DEPTHBUFFER
glShadeModel GL_SMOOTH
glClearColor 0.0,0.0,0.0,0.0
val = 0
While Not KeyDown(KEY_ESCAPE)
glMatrixMode GL_PROJECTION
glLoadIdentity
gluPerspective 45,800/600,0.1,100
glMatrixMode GL_MODELVIEW
glLoadIdentity
glClearDepth 0.0
glViewPort 0,0,800,600
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glRotatef val,0,0,0
val = val + 1
glBegin GL_QUADS
glVertex2f -1,1
glVertex2f 1,1
glVertex2f 1,-1
glVertex2f -1,-1
glEnd
FlushMem
bglSwapBuffers
Wend
End
But it seems to produce a blank window. Further, when I previously tried it without the rotation, it did produce a quad but it was rectangular rather than square, suggesting that the aspect ratio was wrong.
I've tried re-arranging all of the initialisation stuff several times and copying the order out of the OpenGL example included with blitzMax but it still refuses to show anything. Can anyone give me a clue what's going on?