Try PB6.00 it's only in beta for the c backend the fasm code is stable
Code: Select all
ExamineDesktops()
Debug "width " + DesktopWidth(0)
Debug "height " + DesktopHeight(0)
Debug "Res x " + DesktopResolutionX()
Debug "Res y " + DesktopResolutionY()
Dw = DesktopWidth(0)
Dh = DesktopHeight(0)
W=1500
H=1500
If InitSprite() = 0
MessageRequester("Error", "Can't open screen & sprite environment!", 0)
End
EndIf
#autoscale=0
#FLAGS = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered
If OpenWindow(0,0,0,W,H,"Windowed screen test ",#FLAGS)
If #autoscale
res = OpenWindowedScreen(WindowID(0),0,0,W,H,#autoscale,0,0)
Else
res = OpenWindowedScreen(WindowID(0),0,0,DW,DH,#autoscale,0,0)
EndIf
If res
CreateSprite(0, 50, 50) ; Create an empty sprite, will be whole black
Repeat
Repeat
Event = WaitWindowEvent(10)
If Not #autoscale
w = WindowWidth(0)
EndIf
If Event = #PB_Event_CloseWindow
End
EndIf
Until Event = 0
FlipBuffers()
ClearScreen(RGB(0, 0, 200)) ; A blue background
DisplaySprite(0, 10, 10) ; Display our black box at the left-top corner
DisplaySprite(0, W-60, 10); Display our black box at the right-top corner
DisplaySprite(0, 10, H-150)
DisplaySprite(0,W-60,H-150)
out.s = Str(W)
If StartDrawing(ScreenOutput())
DrawText((W>>1)-(TextWidth(out)>>1),100,out,RGB(0,255,0),RGB(0,0,255))
StopDrawing()
EndIf
ForEver
Else
MessageRequester("Error", "Can't open windowed screen!", 0)
EndIf
Else
MessageRequester("Error", "Can't open windowed!", 0)
EndIf