#include <gl.au3>

Opt("GUIOnEventMode", 1)

Global $gui = GUICreate("OpenGL", 250, 250), $dc, $rc
GUISetOnEvent(-3, "quit")

If Not glInit($gui, $dc, $rc) Then
    MsgBox(48, "Error", "Error bei der Initialisierung von OpenGL-Funktionen" & @CRLF & "Error code: " & @error)
    Exit
EndIf

glMatrixMode($GL_PROJECTION)

GUISetState()


While 1

    glClear($GL_COLOR_BUFFER_BIT)
    glBegin($GL_LINES)

    glColor3ub(0, 255, 0)

    glVertex3f(0, .5, 0)
    glVertex3f(0, -.5, 0)

    glVertex3f( -.5, 0, 0)
    glVertex3f( .5, 0, 0)
    glEnd()


    glSwapBuffers($dc)

WEnd

Func quit()
	glTerminate($gui, $dc, $rc)
	Exit
EndFunc