https://github.com/macos-powerpc/powerpc-ports ? Hmm...
https://macintoshgarden.org/forum/custom-software-builds-os-x-leopard-32bit ? Hmm...
Hmm...maybe you guys can "SDL2 together"? I know the goals and targets are different, but it seems like there could be some synergy...
My thoughts were they are very active in making sure their SDL2 works well, for the countless game ports. They may have patches and/or configuration that might benefit. By taking advantages of their patches, it might help the problems you've seen and/or get a working more modern cocoa driver, etc. And the idea of working on Intel, is it may help even 10.6.8 ppc, just by knocking out problems and weirdness. But, who knows, maybe I can act like a bee, and cross pollinate if I see something useful...
Ok, barracuda156, so previously I believe you'd reported problems with SDL2, building, but not running. From what I remember, two of the configurations was a 10.5.x G5, and then 10.6.8 ppc, in general.
Let me know if you did see problems with 10.5.x, and I can specifically try and reproduce them, and look at that. If I don't see the problems on my G4, we can then narrow it down to something on your system.
If you had problems with 10.6.8 ppc, let me know exactly which version you were using, because, if I were to look into SDL2 issues on it, I would want to install as closely a version as you are using.
I don't have any Nvidia mac cards, so obviously won't be able to test that.
If you'd like me to test on PPC Snow Leopard, let me know exactly which image you are using, there seem to be multiple ones out there, possibly from multiple people.
And obviously I'll need XCode...
and probably your macports? I've got some time, so I don't mind looking, but want to make sure I'm runing the same one you are. (If we're different, we've got too many variables from the start).
Ok, to be clear, you are saying the only SDL problems on 10.5 are with Nvidia, correct? With ATI there are no problems? If that's the case, then maybe I have a good excuse to get around to flashing an Nvidia card.
The fact that it works on "older" versions (10a190 and "Nvidia"), but not A5 sounds like a red flag...if I'm following correctly. Is this not a problem with A5 10.6 ppc itself, and not ports or anything that could be fixed in SDL?
Hmm...very confusing. I'm not sure how to proceed or be of much help, in the case of 10.6.8. Without a stable foundation...or, in this case multiple semi-stable ones...it isn't possible to tell when there are problems if it is with the foundation or with what is being built on it. It doesn't sound like the problems are with SDL at all, but maybe you're thinking tweaks to it to get around limitations? (Like not using a particular gl extension that isn't working or is missing?)
On 10.5.8 ppc64, I'm assuming you're building SDL2 (and all of ports?) 64 bits, correct?
I did see problems on my 32 bit machine, but they were related to X11's GLX. Note that the SDL2 X11 driver is usually still built and included even when the Cocoa one is in there. I mention that in case you may be having GLX problems (SDL2 may still be opening it). Be sure "glxinfo" works and shows it is accelerated (not using software renderer, which is what I saw at first). Want to be sure the problem is not with your X11 (indirectly).
Oh! If you mean just try running a version that I'd previously built, such as on Leopard, to see that it works, I could definitely do that. I can certainly just install A5 and try running what I already have, as a sanity check. For a further check, I can test the same scenario on Intel (ie running a previously built version on Snow Leopard).If you can just install existing A5 image and try using SDL2, that will be very helpful. Maybe I am just doing something wrong after all, or maybe it is some local hardware-caused issue.
It is useful to verify independently. A5 is the “reference” in a sense of community settling on it for quite a while. If there is a bug, it is better it is confirmed, and then it can be fixed. If I am missing some part locally, then I unnecessarily abstain from Cocoa backend on it.
Since you have everything pre-built, this should be a matter of an hour or two.
Ok, then I can't reproduce the problem. It is working on 32 bit ppc leopard for me.Yes, everything on ppc64 is ppc64, aside of MacPorts base.
I had to install version 2.3.3.2 of xquartz from https://www.xquartz.org/index.html. I first tried the next higher version than what shipped with Leopard, and then kept trying each version until I found the oldest one that worked. This is with a Radeon 7000, with a Rage 128 all GLX programs crash with a "Context" error.How did you solve this issue, to get hardware acceleration with GLX?
SDL-2.0.3's testgl2 reported "No displays were added", using cocoa driver (did not test X11 driver).
SDL-2.32.4's testgl2 worked fine with acceleration using X11 driver.
That's good! Hopefully that means we can then (mostly) count on a few different things then:This sounds like what I am getting as well.
I don't know if it is of interest to you, but with a bit of hacking I was able to get the Cocoa driver from SDL 2.0.3 to work with SDL 2.32.4, and run with accelerated OpenGL on 10.5.8. It wouldn't be hard to use it with a newer SDL 2.3x.x.
I tested it on A5, and it just printed "INFO" and quit. There is a bug/feature in the SDL 2 logging functions on MacOS X (at least in the SDL 2.32.4 that I have) where it tries to use NSLog, but doesn't do it quite correctly. I believe I had a "fix" to make it use stderr instead (which SDL 2 does on linux) at some point, and will try that again, so I can at least see the error on A5.
EDIT: So I fixed the logging output and you'll NEVER guess what it said on A5! Yep..."The video driver did not add any displays". So, will be adding some debug printf's the hacked Cocoa driver to see what I can see...
Ok, found the problem with the 2.0.3 Cocoa driver and A5. Bad news is there's a CoreGraphics call that on A5 doesn't seem to work (CGDisplayCopyDisplayMode), good news is you only have to change a single line in the driver. (Tested vs Snow Leopard on Intel, where it does work, so definitely bug/unimplemented in A5).
In SDL_cocoamodes.m:
/* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
#define FORCE_OLD_API 0
Change the 0 to 1, and it will use pre Snow Leopard calls, which work fine on A5 (and, of course, on Tiger and Leopard).
----
I followed your instructions, and used the downloads at https://macos-powerpc.org/installation.html and was able to build both versions of SDL2 on A5. Both 2.0.x and 2.3x.x work with Cocoa and accelerated opengl. (This was just raw source folders, no macports still)
The Cocoa driver I have for 2.3x.x is the 2.0.x one, hacked to work with the newer SDL2, so a wholesale replacement of src/video/cocoa for "modern" SDL2, as opposed to patches.
Not sure how (or if!) you'd want to handle/integrate it for the port, I'll leave that up to you. It is a bit of mess currently (debug printfs, etc), and I left some things unfixed, so I'll clean it up, and can just put the whole tar'd cocoa folder as an attachment relatively soon.
FYI, I believe I see the same issue on sl ppc A5 in the Cocoa driver for my copy of SDL 1.2.15 (CGDisplayCopyDisplayMode is failing). This causes the Cocoa driver to not work on A5. Same SDL 1.2.15 source works fine on Leopard and on Intel Snow Leopard.
Let me know if SDL 1's Cocoa driver is working on your A5 machine.
Ok, this is based on SDL 2.0.3, but should work dropped into SDL 2.3x.x. If it doesn't let me know the version.
For some reason either my browser or the site isn't letting me attach the gzip'd tar files. So I've temporarily added them to the MG page I set up:
"test" is the full changes, but there are a few things related to "drop files" and "touch events" I'm not sure how to test and guessed the code, it is likely correct, but I'm not positive. "safe" includes the code I'm not sure of commented out with "???" next to it.
Because this has been more fruitful, and A5 much more usable, than I expected, I could possibly look into some other things in a similar vein.
In SDL_cocoamodes.m:
/* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
#define FORCE_OLD_API 0
Change the 0 to 1, and it will use pre Snow Leopard calls, which work fine on A5 (and, of course, on Tiger and Leopard).