Code: Select all
EnableExplicit
Global quit, event
InitSprite()
If OpenWindow(0, 0, 0, 320, 240, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If OpenWindowedScreen(WindowID(0), 0, 0, 320, 240)
Repeat
Repeat
event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
quit = 1
EndSelect
Until event = 0
ClearScreen(RGB(0, 0, 0))
If StartDrawing(ScreenOutput())
Box(10, 10, 32, 32, RGB(255, 0, 0))
StopDrawing()
EndIf
FlipBuffers()
Until quit
EndIf
EndIf