12-10-2005, 07:31 AM
You don't always need to clear the depth buffer, but I do anyway so i don't forget.
Code:
'$include: 'gl/gl.bi'
'$include: 'gl/glu.bi'
'$include: 'gl/glfw.bi'
if glfwInit <> GL_TRUE then
print "could not init"
end 1
end if
if glfwOpenWindow(640, 480, 8, 8, 8, 8, 24, 8, GLFW_Fullscreen) <> GL_TRUE then
print "could not open window"
glfwTerminate
end 1
end if
glViewport 0, 0, 640, 480
do
glClear GL_COLOR_BUFFER_BIT OR GL_DEPTH_BUFFER_BIT
glBegin GL_LINES
glVertex2f 0,0
glVertex2f 1,1
glEnd
glFlush
glfwSwapBuffers
if glfwGetKey(GLFW_KEY_ESC) or glfwGetWindowParam(GLFW_OPENED) = 0 then exit do
loop
glfwTerminate