How can it be converted to work (with minimal changes) using OpenScreen() rather than OpenWindowedScreen() ?
The sticking point is that FlipBuffers() seems to behave differently between the two screen modes, making conversion difficult.
I would be grateful for any advice.
Code: Select all
; Ikeda Attractor AKJ 07-Jun-09
EnableExplicit
Define xoff=300, yoff=400, scale=170
Define.d c1=0.4, c2=0.9, c3=6.0, rho=1.0
Define i, j, k
Define.d temp, sin_temp, cos_temp, xt, y, x
initsprite(): initkeyboard()
OpenWindow(0,0,0,800,600,"Ikeda Attractor",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),5,5,800,600,0,0,0)
;!!! OpenScreen(800, 600, 32, "Ikeda Attractor")
ClearScreen(#Yellow)
StartDrawing(ScreenOutput())
x = 0.1: y= 0.1
For i = 0 To 300000
temp = c1 - c3 / (1.0 + x * x + y * y)
sin_temp = Sin(temp)
cos_temp = Cos(temp)
xt = rho + c2 * (x * cos_temp - y * sin_temp)
y = c2 * (x * sin_temp + y * cos_temp)
x = xt
j = x * scale + xoff
k = y * scale + yoff
Plot(j, k, #Blue)
If i%500=0
StopDrawing(): FlipBuffers(): StartDrawing(ScreenOutput())
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape): Break: EndIf
EndIf
Next i
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(10,10, "Press ESC to exit") ; Let user know the drawing is finished
StopDrawing()
FlipBuffers()
Repeat: ExamineKeyboard(): Until KeyboardPushed(#PB_Key_Escape)
CloseScreen()
End