Notes:
- Tested under Win10, Win 11 and Ubuntu
- (optional) try setting the Library Subsystem in Compiler options to DirectX9
Code: Select all
InitSprite() :
W=760 : H=540 : C = $324F72 : Cellsize = 50 : LoadFont(99, "Consolas", 32)
OpenWindow(0, 35, 35, W+1, H, "firace's spinblur clock", #PB_Window_SizeGadget|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,W+1,H,1,0,0) : AddWindowTimer(0, 1, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Timer :
ClearScreen(0)
FlipBuffers()
CreateSprite(33, W+200,W+200)
StartDrawing(SpriteOutput(33))
DrawingFont(FontID(99))
sec$ = FormatDate("%hh:%ii:%ss", Date())
DrawText(350,350,Sec$)
StopDrawing()
x = 0
Repeat : x+1
StartDrawing(ScreenOutput())
Box(-90,-140,W+200,W+200,0)
StopDrawing()
RotateSprite(33, 18,#PB_Relative) : DisplayTransparentSprite(33,-90,-140,42)
FlipBuffers()
Until x = 20
StartDrawing(ScreenOutput())
Box(-90,-140,W+200,W+200,0)
StopDrawing()
DisplayTransparentSprite(33,-90,-140,242)
FlipBuffers()
EndSelect
ForEver