OpenWindowedScreen() and alpha transparency
Posted: Fri Jan 23, 2026 9:05 am
It seems there's a problem with alpha tranparency in a OpenWindowedScreen on MacOS.
The sample code below displays 20 squares with increasing alpha transparency.
It works fine on Windows
But on MacOS (MacBook pro M4, MacOS 26.2, PB 6.21), all squares are white, no transparency is applied.
Can anybody else confirm ?
The sample code below displays 20 squares with increasing alpha transparency.
It works fine on Windows
But on MacOS (MacBook pro M4, MacOS 26.2, PB 6.21), all squares are white, no transparency is applied.
Code: Select all
InitSprite()
OpenWindow(0, 0, 0, 330, 160, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, DesktopScaledX(330), DesktopScaledY(160))
Repeat
Repeat
Event = WindowEvent()
If event = #PB_Event_CloseWindow
End
EndIf
Until Event = 0
If StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_AlphaBlend)
For i = 1 To 20
Box(DesktopScaledX(i * 15), DesktopScaledY(50), DesktopScaledX(14), DesktopScaledY(14), RGBA(255, 255, 255, 255 - (i * 10)))
Next i
StopDrawing()
EndIf
FlipBuffers()
ClearScreen(0)
ForEver