my name is Danilo and i am new to MacOSX programming. Found a behavior that
usually worked correctly on Windows OS:
Code: Select all
EnableExplicit
ExamineDesktops()
Define.i dw = DesktopWidth(0)
Define.i dh = DesktopHeight(0)
Define.i dd = DesktopDepth(0)
Debug dw
Debug dh
Debug dd
;dd = 32
If InitSprite()=0 Or InitKeyboard()=0 Or OpenScreen(dw, dh, dd, "TestScreen")=0
MessageRequester("ERROR","Failed To 'InitSprite/InitKeyboard/OpenScreen'")
End
EndIf
Repeat
ClearScreen(RGB(255,255,0))
FlipBuffers()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape) : End : EndIf
ForEverSo I have to use the line "dd = 32" explicitly.
Is this normal on MacOSX? Or is DesktopDepth() wrong and should return 32, too?
This works:
Code: Select all
EnableExplicit
ExamineDesktops()
Define.i dw = DesktopWidth(0)
Define.i dh = DesktopHeight(0)
#title = "ScreenTest"
Debug dw
Debug dh
If InitSprite()=0 Or InitKeyboard()=0
MessageRequester("ERROR","Failed To 'InitSprite/InitKeyboard'")
End
EndIf
If OpenScreen(dw,dh,32,#title)=0
If OpenScreen(dw,dh,24,#title)=0
If OpenScreen(dw,dh,16,#title)=0
MessageRequester("ERROR","'OpenScreen' failed")
End
:EndIf:EndIf:EndIf
Repeat
ClearScreen(RGB(255,255,0))
FlipBuffers()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape) : End : EndIf
ForEverMac Mini Server, i7 QuadCore 2.6GHz, 16GB mem, Intel HD4000 graphics, OS X 10.8.4


