You'll also notice if you take the top flipbuffers() and add another to the repaint event handler that you will also see the rectangles. How is this possible if I draw on the back buffer and call flipbuffers() twice (so that the original back buffer is again the back buffer).
Code: Select all
If InitSprite()=0 : End : EndIf
Procedure draw(x)
StartDrawing(ScreenOutput())
Box(x, 10, 10, 10, RGB(255,0,0))
StopDrawing()
EndProcedure
If OpenWindow(0, -1, -1, 400, 300, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar, "blah!")
If OpenWindowedScreen(WindowID(), 140, 20, 200, 200, 0, 20, 20)
SetFrameRate(2)
draw(10)
FlipBuffers()
draw(20)
Repeat
ev.l = WaitWindowEvent()
While ev
Select ev
Case #PB_Event_CloseWindow
quit = 1
Case #PB_Event_Repaint
Debug "Repaint"
FlipBuffers()
EndSelect
ev = WindowEvent()
Wend
Until quit=1
EndIf
EndIf
End


