Mal ein kleines Experiment, der Name sagt ja alles ^^.
Spoiler anzeigen
; Ported from http://nerdworld.de/programmierung…l-in-farbe.html
#include <gl.au3>
Opt("GUIOnEventMode", 1)
Global $iSize = 500, $iScale = (2/$iSize)
Global $gui = GUICreate("OpenGL", $iSize, $iSize), $dc, $rc, $l = GUICtrlCreateLabel("Bitte (lange) warten", 0, 0)
Global $aPixel[$iSize+1][$iSize+1], $maxpix = $iSize^2, $halfsize = $iSize/2
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
GUISetState()
glMatrixMode($GL_PROJECTION)
$maxiteration = 15
glClear($GL_COLOR_BUFFER_BIT)
glBegin($GL_POINTS)
for $py = 0 to $iSize step 1
for $px = 0 to $iSize Step 1
$x0 = (4/$iSize)*$px-2
$y0 = (4/$iSize)*$py-2
$x = $x0
$y = $y0
$iteration = 0
While (($x^2 + $y^2) < 4 AND $iteration < $maxiteration)
$xtemp = $x*$x - $y*$y + $x0
$y = 2*$x*$y + $y0
$x = $xtemp
$iteration+= 1
WEnd
glColor3ub(0, 0, 255*($iteration/$maxiteration))
glVertex2d($iScale*($px-$halfsize), -($iScale*($py-$halfsize)))
Next
Next
glEnd()
glSwapBuffers($dc)
While 1
WEnd
Func quit()
glTerminate($gui, $dc, $rc)
Exit
EndFunc