1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
; ------------------------------------------------------------
; graphical test in a window
; ------------------------------------------------------------
i=0
x=0
y=0
pi=3.1415927
If InitKeyboard() = 0 Or InitMouse() = 0 Or InitSprite() = 0
MessageRequester("Error", "Can't open system resources", 0)
End
EndIf
If OpenWindow(0, 0, 0, 200, 200, "A screen in a window...", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
If OpenWindowedScreen(WindowID(0), 0, 0, 1, 1, 1, 0, 0)
Else
MessageRequester("Error", "Can't open windowed screen!", 0)
End
EndIf
EndIf
Repeat
i=i+1 : If i>359 : i=0 : EndIf
Repeat
Event = WindowEvent()
If Event = #PB_Event_CloseWindow
End
EndIf
Until Event = 0
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
StartDrawing(WindowOutput(0))
For j=0 To 9
Line(75,75,50*Sin((i+j)/360*2*pi),50*Cos((i+j)/360*2*pi),RGB(j*25,j*25,j*25))
Next j
StopDrawing()
; Delay(1)
ForEver |
Partager