Thanks, Jesper.
Here's one example, derived from one of PB's sample codes
(since I mislaid the original code which was even simpler).
Code:
;
; ------------------------------------------------------------
;
; PureBasic - 2D Drawing example file
;
; (c) 2005 - Fantaisie Software
;
; ------------------------------------------------------------
;
; fix for fullscreen multi monitor bug in PB DirectX9
;
; Fullscreen problem with dualscreen monitor:
; http://www.purebasic.fr/english/viewtopic.php?f=4&t=41281
;
CallFunction(OpenLibrary(#PB_Any,"dwmapi.dll"),"DwmEnableComposition",0)
InitSprite()
OpenScreen(1920,1080,32,"HHH")
If StartDrawing(ScreenOutput())
Circle(100,100,50,RGB(0,0,255)) ; a nice blue circle...
Box(150,20,20,20, RGB(0,255,0)) ; and a green box
FrontColor(RGB(255,0,0)) ; Finally, red lines..
For k=0 To 20
LineXY(10,10+k*8,200, 0)
Next
DrawingMode(#PB_2DDrawing_Transparent)
BackColor(RGB(0,155,155)) ; Change the text back and front colour
FrontColor(RGB(255,255,255))
DrawText(10,50,"Hello, this is a test")
StopDrawing()
FlipBuffers()
EndIf
; Create a gadget to display our nice image
;
; ImageGadget(0, 0, 0, 0, 0, ImageID(0))
;
; This is the 'event loop'. All the user actions are processed here.
; It's very easy to understand: when an action occurs, the EventID
; isn't 0 and we just have to see what have happened...
;
Delay(1000)
End ; All the opened windows are closed automatically by PureBasic