Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alex_free

macrumors 65816
Original poster
Feb 24, 2020
1,165
2,457

Panther_SDL2 is a fork of SDL2 (version 2.0.3) which is compatible with Mac OS X 10.3.9
and Mac OS X 10.4.x. Currently SDL2 2.0.3 requires an Intel Mac OS X 10.5 mac to run, and
the Mac OS X 10.7 SDK at the 10.5 MACOSX_DEPLOYMENT_TARGET to compile.

Panther_SDL2 takes Thomas Bernard's excellent Mac OS X 10.4 SDK Tiger patches to the next level,
making it work at the MACOSX_DEPLOYMENT_TARGET of version 10.3, which enables Mac OS X 10.3.9
compatibility for the first time ever (10.3.8 and below will not work with this method). Xcode
2.5 has been tested.

Thomas Bernard's original unified patch, and my indivisual patches created from his unified patch
can be found in the folder 'thomas_bernard_sdl_2.0.3_patches'. My patches can be found in the
directory 'sdl2_2.0.3_panther_patches'. These are all against the official SDL2 version 2.0.3
release.

==

If you are building for a Panther target:



export MACOSX_DEPLOYMENT_TARGET=10.3
./configure --without-x --disable-joystick --disable-haptic
make
sudo make install

If you are building for Tiger:
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --without-x --disable-joystick --disable-haptic
make
sudo make install


==

Thomas BERNARD Tiger Patch:
https://gist.github.com/miniupnp/26d6e967570e5729a757

Found from this post:
https://forums.libsdl.org/viewtopic.php?p=41191
 
Last edited:
Reuploaded my old SDL2 projects here (fixed above link for panther sdl2 as well):
https://github.com/alex-free/panther-sdl2 (Mac OS X 10.3.9+) - Xcode v2.5
https://github.com/alex-free/leopard-sdl2 (Mac OS X 10.5+) - Xcode v3.0

Both use native Mac OS X APIs and do not require MacPorts. Actually, these had problems being built by newer GCC 4.9 (not tested on above). You can still link gcc4.0/4.2 libs with newer gcc though...

These were used in things like SM64EX and IOQuake3, and PantherSDL2 is still used to compile FFPlay v4.4.5.
 
Last edited:
Reuploaded my old SDL2 projects here (fixed above link for panther sdl2 as well):
https://github.com/alex-free/panther-sdl2 (Mac OS X 10.3.9+) - Xcode v2.5
https://github.com/alex-free/leopard-sdl2 (Mac OS X 10.5+) - Xcode v3.0

Both use native Mac OS X APIs and do not require MacPorts. Actually, these had problems being built by newer GCC 4.9 (not tested on above). You can still link gcc4.0/4.2 libs with newer gcc though...

These were used in things like SM64EX and IOQuake3, and PantherSDL2 is still used to compile FFPlay v4.4.5.

Thanks, I will try building Leopard version’s Cocoa part with modern SDL2, if that works (it probably will, if it is 2.0.6 and not heavily modified), we can update the port for libsdl2-cocoa.
 
@alex_free BTW, maybe you can make a PR?
Currently don’t have leopard installed anywhere, but I will certainly if I can get the time. Lmk if you have questions, cocoa works this was used in the sm64ex ports to ppc leopard on archive.org. The only thing that doesn’t work is controllers iirc.
 
  • Like
Reactions: barracuda156
Currently don’t have leopard installed anywhere, but I will certainly if I can get the time. Lmk if you have questions, cocoa works this was used in the sm64ex ports to ppc leopard on archive.org. The only thing that doesn’t work is controllers iirc.

Did you try to fix joystick support? A lot of games and emulators which use SDL2 need that, so while they may build fine, they won’t actually launch. (This is not something which I personally need – my use-cases for SDL differ, but I think a lot of ppl here want that sort of stuff.)

P. S. If you happen to have a patch as a patch (not as a single all-in commit merged with a source), it would make life easier LOL. If you don’t, don’t bother, I can generate a diff, I guess.
 
Did you try to fix joystick support? A lot of games and emulators which use SDL2 need that, so while they may build fine, they won’t actually launch. (This is not something which I personally need – my use-cases for SDL differ, but I think a lot of ppl here want that sort of stuff.)

P. S. If you happen to have a patch as a patch (not as a single all-in commit merged with a source), it would make life easier LOL. If you don’t, don’t bother, I can generate a diff, I guess.
I honestly did not really try, it might be easy. All the stuff I compiled with it I could use keyboard/mouse. It might be able to be fixed easily.

Thomas Bernard sdl2.0.6 patch:

Then replace this file (it’s from SDL 2.0.3) https://github.com/alex-free/leopard-sdl2/blob/master/src/video/cocoa/SDL_cocoakeyboard.m

It think that’s everything. It was a lot less then what panther sdl 2 needed:

My panther patches:

Thomas Bernard’s tiger patches for sdl2.0.3
 
  • Like
Reactions: G4fanboy
@alex_free Could you say, by chance, if SDL2 (Cocoa-based) works on the following configurations, if you tried these?

1. Any macOS, ATI GPU.
2. 10.5.8 ppc64, any GPU.
3. 10.6.8 A5 image, any GPU.

I am specifically interested in video output (say, with ffplay), but any confirmation of GUI window will be useful.
 
  • Like
Reactions: alex_free
@alex_free Could you say, by chance, if SDL2 (Cocoa-based) works on the following configurations, if you tried these?

1. Any macOS, ATI GPU.
2. 10.5.8 ppc64, any GPU.
3. 10.6.8 A5 image, any GPU.

I am specifically interested in video output (say, with ffplay), but any confirmation of GUI window will be useful.
Yes it’s working even on an a Mac mini g4 on panther (ati 9200 OGL 1.4).
 
On a side note, apparently mpv just uses X11 directly, when SDL2 is built with +x11 (without Cocoa):

Code:
$ mpv /Users/svacchanda/Movies/viu/Bad\ Girl/Bad\ Girl\;\ Episode\ 9.mp4
● Video  --vid=1               (h264 1920x1080 24 fps) [default]
● Audio  --aid=1  --alang=jpn  (aac 2ch 48000 Hz 129 kbps) [default]
[vo/gpu/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu-next/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu-next/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/xv] No Xvideo support found.
[vo/sdl] SDL_CreateRenderer failed
[vo/sdl] SDL_CreateRenderer failed
[vo/sdl] No supported renderer
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
AO: [coreaudio] 48000Hz stereo 2ch floatp
VO: [x11] 1920x1080 yuv420p
[vo/x11] Shared memory not supported
[vo/x11] Reverting to normal Xlib
[vo/x11] Shared memory not supported
[vo/x11] Reverting to normal Xlib

But it works. Cocoa, on the other hand, spits this and provides no video output for me on A5 now.

Code:
36-5:~ svacchanda\$ mpv /Users/svacchanda/Movies/viu/Bad\ Girl/Bad\ Girl\;\ Episode\ 9.mp4 
● Video  --vid=1               (h264 1920x1080 24 fps) [default]
● Audio  --aid=1  --alang=jpn  (aac 2ch 48000 Hz 129 kbps) [default]
[vo/sdl] SDL_Init failed
Error opening/initializing the selected video_out (--vo) device.
Video: no video
AO: [coreaudio] 48000Hz stereo 2ch floatp
 
Last edited:
On a side note, apparently mpv just uses X11 directly, when SDL2 is built with +x11 (without Cocoa):

Code:
$ mpv /Users/svacchanda/Movies/viu/Bad\ Girl/Bad\ Girl\;\ Episode\ 9.mp4
● Video  --vid=1               (h264 1920x1080 24 fps) [default]
● Audio  --aid=1  --alang=jpn  (aac 2ch 48000 Hz 129 kbps) [default]
[vo/gpu/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu-next/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/gpu-next/opengl] GLX does not support GLX_ARB_create_context_profile
[vo/xv] No Xvideo support found.
[vo/sdl] SDL_CreateRenderer failed
[vo/sdl] SDL_CreateRenderer failed
[vo/sdl] No supported renderer
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
AO: [coreaudio] 48000Hz stereo 2ch floatp
VO: [x11] 1920x1080 yuv420p
[vo/x11] Shared memory not supported
[vo/x11] Reverting to normal Xlib
[vo/x11] Shared memory not supported
[vo/x11] Reverting to normal Xlib

But it works. Cocoa, on the other hand, spits this and provides no video output for me on A5 now.

Code:
36-5:~ svacchanda\$ mpv /Users/svacchanda/Movies/viu/Bad\ Girl/Bad\ Girl\;\ Episode\ 9.mp4
● Video  --vid=1               (h264 1920x1080 24 fps) [default]
● Audio  --aid=1  --alang=jpn  (aac 2ch 48000 Hz 129 kbps) [default]
[vo/sdl] SDL_Init failed
Error opening/initializing the selected video_out (--vo) device.
Video: no video
AO: [coreaudio] 48000Hz stereo 2ch floatp
Never compiled it on anything newer then leopard personally. Or 64bit PPC due to lack of said hardware. Is this above the leopard sdl 2 code I uploaded? Is there a minimum sdl needed for mpv?
 
Is this above the leopard sdl 2 code I uploaded?

Not [yet], I used the existing port which has Cocoa part from 2.0.3, and otherwise uses the current release of SDL2.

Is there a minimum sdl needed for mpv?

Dunno if explicitly, but it won’t compile against the 2.0.x, as I recall, but will compile with the modern SDL2 with its Cocoa part replaced. Also, I had the same mpv working via Cocoa on 10.6.8 (Nvidia image) with Nvidia card. So it can work, for the fact. Either something is wrong in A5 image, or with ATI card which I have now in the machine, or I missed some esoteric env settings, which were in place in the earlier installation, or some combo of these.

P. S. Given that A5 has GL-related stuff from 10.5.8, while Nvidia-specific image has those from 10a190, I suspect it is that. Which sucks, if so, since A5 is the latest one, and has networking fixed. This I can check, just need to spend a couple of hours for a new installation.
 
Is this above the leopard sdl 2 code I uploaded?

I will try using 2.0.6 source (for Cocoa part) with your patch. Not sure whether enabling X11 simultaneously is a good idea, but I can try both. The only thing which won’t work is using anything in /usr/X11, since Apple X11 breaks everything else, if it is found. Perhaps it can be used from some non-default prefix, if turns out to be unavoidable.
 
@alex_free The patch for 2.0.6 is incomplete, it seems (but I guess, no one tested it on 10.6):
Code:
In file included from /opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaclipboard.m:25:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoavideo.h:96: error: ‘NSFullScreenWindowMask’ undeclared here (not in a function)
make: *** [build/SDL_cocoaclipboard.lo] Error 1
make: *** Waiting for unfinished jobs....
In file included from /opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaevents.m:26:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoavideo.h:96: error: ‘NSFullScreenWindowMask’ undeclared here (not in a function)
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaevents.m: In function ‘CreateApplicationMenus’:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaevents.m:380: error: ‘NSAppKitVersionNumber10_6’ undeclared (first use in this function)
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaevents.m:380: error: (Each undeclared identifier is reported only once
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoaevents.m:380: error: for each function it appears in.)
make: *** [build/SDL_cocoaevents.lo] Error 1
In file included from /opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:25:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoavideo.h:96: error: ‘NSFullScreenWindowMask’ undeclared here (not in a function)
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m: In function ‘HIDCallback’:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:217: warning: ISO C90 forbids mixed declarations and code
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:222: warning: ISO C90 forbids mixed declarations and code
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m: In function ‘InitHIDCallback’:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:274: warning: ISO C90 forbids mixed declarations and code
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:284: warning: ISO C90 forbids mixed declarations and code
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m: In function ‘UpdateKeymap’:
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:536: warning: ISO C90 forbids mixed declarations and code
/opt/local/var/macports/build/libsdl2-cocoa-09e2978a/work/SDL2-2.32.10/src/video/cocoa/SDL_cocoakeyboard.m:573: error: too few arguments to function ‘SDL_SetKeymap’
make: *** [build/SDL_cocoakeyboard.lo] Error 1
 
@alex_free A quick update:

sdl2 with 2.0.3 (which worked for me with 10.6.8-nvidia and nvidia gpu) fails to open GUI window with:
Code:
Could not initialize SDL: The video driver did not add any displays

sdl2 with 2.0.6 (and video/cocoa part of the patch for 2.0.6 linked above, with a few fixes to make it compile) fails with Bus error on SDL_VideoInit_REAL, both on 10.6.8 and 10a190 (tried with lite-xl and ffplay). So there is something wrong more with the patch, which I did not fix yet, but given that it works for you on < 10.6, the bug should be in the code which is not used on < 10.6.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.