OpenWindowedScreen() and alpha transparency

Mac OSX specific forum
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 526
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

OpenWindowedScreen() and alpha transparency

Post by Mindphazer »

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.

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
Can anybody else confirm ?
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 26.1 - Iphone 17 Pro Max - iPad at home
...and unfortunately... Windows at work...