|
Allegro 4.4 OS X Full Screen Patch for Lion Crash |
Todd Cope
Member #998
November 2000
|
Attached is a patch to fix the crashing bug that affects the OS X port on Lion. We now check that the return value of CGDisplayBaseAddress() is not NULL before using it as a base address in which to store bitmap data. This code is untested (I don't have Lion), but it does compile. |
kazzmir
Member #1,786
December 2001
|
I'm just curious, so with your patch fullscreen mode would simply fail instead of crashing? I had problems entering fullscreen mode in osx before (possibly snow leapord). That was one of the main motivations for me to move to SDL at the time. |
Evert
Member #794
November 2000
|
My understanding was that Allegro 4 would not work at all on OS X (EDIT: Lion) due to the deprecated API it uses finally being removed...? |
Todd Cope
Member #998
November 2000
|
kazzmir said: I'm just curious, so with your patch fullscreen mode would simply fail instead of crashing? Yes. The crash is due to trying to access a NULL pointer. This is caused by Allegro assuming the return value of CGDisplayBaseAddress() will always be valid when in reality it is allowed to return NULL. I'm not sure what else might need to be fixed but I do know that an Allegro 4 program will start up in windowed mode just fine on Lion. |
Elias
Member #358
May 2000
|
The API wasn't actually removed, just hidden (otherwise old binaries would stop working as well). SDL contains some hacks to make the compiler "unhide" the API at compile-time and therefore they can still use fullscreen (using the same outdated API we use). Myself I have my hopes in kazzmir's A4-in-A5 library though, once that's a bit further it should make A4 code run nicely (with some modifications, but much less than a full port to A5). Just needs more contributors as well -- |
Todd Cope
Member #998
November 2000
|
Not sure how SDL could get a full screen mode with a pointer to the screen without a valid address to write to, since the function Allegro uses to get that address returns NULL on Lion. Unhiding an API at compile time won't fix that kind of issue. |
Elias
Member #358
May 2000
|
Oh, you simply never coded under OSX yet. Whether the function returns NULL may be decided depending on the version it was compiled with... so if you manage to forge that version... -- |
Todd Cope
Member #998
November 2000
|
You are wrong. Here's a comment from the change where the issue was fixed in SDL: Quote: Mac OS X Lion (10.7) always returns NULL from CGDisplayBaseAddress(), so all
|
Evert
Member #794
November 2000
|
Elias said: The API wasn't actually removed, just hidden (otherwise old binaries would stop working as well). I thought they had. Quote: SDL contains some hacks to make the compiler "unhide" the API at compile-time and therefore they can still use fullscreen (using the same outdated API we use). Hmm... doesn't sound very future-proof to me. |
|