

Task

Display a smooth shaded triangle with OpenGL.

 Triangle created using C example compiled with GCC 4.1.2 and freeglut3.


 
'Task
'Display a smooth shaded triangle with OpenGL.
Screen _NewImage(600, 600, 32)
Dim Shared glInit As Integer
glInput = 0
Do While InKey$ = "": Loop
End
 
 
Sub _GL ()
    If glInit = 0 Then
        _glViewport 1, 1, 600, 600
        _glClearColor 0, 0, 0, 1
        glInit = -1
    End If
    _glClear _GL_COLOR_BUFFER_BIT
    _glBegin _GL_TRIANGLES
    _glColor4f 1, 0, 0, 1
    _glVertex2f -1, -1
    _glColor4f 0, 1, 0, 1
    _glVertex2f 0, 0
    _glColor4f 0, 0, 1, 1
    _glVertex2f 1, -1
    _glEnd
End Sub
 