Maybe this is something for you (but only OpenGL)
SuperStrict
SetGraphicsDriver GLMax2DDriver()
Graphics 800, 600, 0
Local pie1:TPieClock = TPieClock.Create(300, 300, 24, 3, 20000)' centerX, centerY, radius, margin, duration
pie1.start()
Local pie2:TPieClock = TPieClock.Create(500, 300, 124, 10, 10000)' centerX, centerY, radius, margin, duration
pie2.start()
While Not KeyHit(KEY_ESCAPE)
Cls
pie1.update()
pie2.update()
pie1.draw()
pie2.draw()
Flip
Wend
End
Type TPieClock
Field pfX#
Field pfY#
Field pfR#
Field pfMargin#
Field pfAngle# = 0
Field pfCircumference# 'I use this to calculate the correct number of lines to be drawn in the drawSegment() method
' background color
Field piR1% = 70
Field piG1% = 90
Field piB1% = 90
' segment color
Field piR2% = 30
Field piG2% = 170
Field piB2% = 80
' timer values
Field piStart%
Field pfDuration# 'in milliseconds
Function Create:TPieClock(fx#, fy#, fr#, fm# = 0, fDur# = 1000)
Local p:TPieClock = New TPieClock
p.pfX = fx
p.pfY = fy
p.pfR = fr
p.pfMargin = Min(fm, fr-1)
p.pfCircumference = 2 * Pi * (fr-fm)
p.pfDuration = fDur
Return p
End Function
Method start()
piStart = MilliSecs()
End Method
Method update()
Local p# = eTime()
If p>=1 Then
'ok, time's up
p = 1
End If
pfAngle = p * 360
End Method
Method draw()
SetColor(piR1, piG1, piB1)
DrawOval(pfX - pfR , pfY - pfR , pfR * 2 , pfR * 2)
SetColor(piR2, piG2, piB2)
DrawPie(pfX - 0.5, pfY -0.5,pfR - pfMargin,0,pfAngle)
End Method
Method eTime#()
Return (MilliSecs() - piStart) / pfDuration
End Method
End Type
Rem
x , y - centerposition
r - radius
angleS - Startangle
angleE - EndAngle
Stepper - Smoothness ( > rougher , faster | | < smoother , slower)
End Rem
Function DrawPie(X# , y# , r# , angleS# = 0,angleE# = 360,Stepper#=1.0)
Local x1# , y1#
Local multi:Int = 1
Local a# = angleS
glBegin GL_TRIANGLE_FAN
glVertex2f x , y
' a - 90 to have the 0 angle on north direction
If AngleS > AngleE Then
multi = - 1
Repeat
x1 = x + (Cos(a-90) * r)
y1 = y + (Sin(a-90) * r)
glVertex2f x1 , y1
a:+(Abs(Stepper)*multi)
Until a < angleE
Else
Repeat
x1 = x + (Cos(a-90) * r)
y1 = y + (Sin(a-90) * r)
glVertex2f x1 , y1
a:+(Abs(Stepper)*multi)
Until a > angleE
EndIf
glEnd
End Function