OpenScreen() on Mac M1

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

OpenScreen() on Mac M1

Post by Mindphazer »

Hi,

when i list all possible resolutions on my Mac M1, using this code from Danilo

Code: Select all

Structure ScreenModeInfo
  width.i
  height.i
  depth.i
  hz.i
EndStructure

NewList modes.ScreenModeInfo()

If InitSprite()
  If ExamineScreenModes()
      While NextScreenMode()
        If AddElement(modes())
          modes()\width  = ScreenModeWidth()
          modes()\height = ScreenModeHeight()
          modes()\depth  = ScreenModeDepth()
          modes()\hz     = ScreenModeRefreshRate()
        EndIf
      Wend
  EndIf
  
  SortStructuredList( modes(), #PB_Sort_Descending, OffsetOf(ScreenModeInfo\width), #PB_Integer)
  
  ForEach modes()
    Debug RSet(Str(modes()\width),4) + "x" + RSet(Str(modes()\height),4) + " - Depth: " + RSet(Str(modes()\depth),3) + " @ " + Str(modes()\hz) + " Hz"
  Next
  
EndIf
If i try to open screen with any of the possible resolution listed, the OpenScreen() function always returns 0

Code: Select all

If InitSprite()
  SWidth = 1512
  SHeight = 982
  SDepth = 32
  If OpenScreen(SWidth, SHeight, SDepth,"Test") = 0;
    MessageRequester("Error", "Can't open a screen " + Str(SWidth) + "x" + Str(SHeight) + " @" + Str(SDepth), 0)
    End
  EndIf 
EndIf
I don't have this issue on my old Intel MacBook...

Is anybody facing the same problem ?

Thanks !

PS : I have no subsystem set in the compiler options
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...