Wii SDL Requiring OpenGX When OpenGL Disabled

support for the powerpc toolchain
Post Reply
Deltaresero
Posts: 2
Joined: Thu Sep 05, 2024 3:37 am

Wii SDL Requiring OpenGX When OpenGL Disabled

Post by Deltaresero » Thu Sep 05, 2024 5:11 am

I've run into some difficulties with SDL 1.2 for Wii, and I'm unsure if it's a bug or if I'm missing something. I'm working on updating and improving the SuperTux Wii port here: https://github.com/DeltaResero/SuperTux-Wii, but I noticed that SDL now unexpectedly requires OpenGX, even though I'm not using OpenGL.

Originally, I thought I'd missed guarding some OpenGL methods, so I added -lopengx to the build to bypass the errors. This didn't resolve the underlying issue and has now resulted in linker errors like "undefined reference to SYS_Report", which I traced back to a recent OpenGX update (debug: use SYS_Report instead of fprintf() by @mardy in #55). While this was temporarily fixed by including OpenGL, the core problem remains that I don't want OpenGL in the project. I'm building with the NOOPENGL flag, yet I still encounter errors like:

Code: Select all

/opt/devkitpro/portlibs/wii/lib/libSDL.a(SDL_ogc_video.o): in function `SDL_OGC_GL_MakeCurrent': undefined reference to `ogx_initialize'

I suspect this issue stems from the SDL commit that added OpenGL support via OpenGX (#75) back in July. It seems OpenGX has become a dependency of SDL’s video functionality, even with OpenGL disabled. Is this a bug in the SDL 1.2 Wii build process, or am I missing something that would fully exclude OpenGX when OpenGL is off?

Any insights would be appreciated!


barfoo34
Posts: 9
Joined: Tue Jan 10, 2023 8:27 pm

Re: Wii SDL Requiring OpenGX When OpenGL Disabled

Post by barfoo34 » Fri Sep 06, 2024 10:46 am

Hi Deltaresero,
sorry for the trouble this caused, I obviosuly forgot to add some #ifdefs around the opengx stuff in the SDL1 code, I'll fix that.

On the other hand, it's always recommended that you use the packages from the devkitPro repository (which, by the way, you probably haven't updated in a while, since the SYS_Report() method was added several months ago); then you wouldn't need to worry about opengx, because it would just not be used if your game doesn't require it (I'm afraid that it would still be built into the binary, due to how SDL initializes it, but that shouldn't cause much harm).


Deltaresero
Posts: 2
Joined: Thu Sep 05, 2024 3:37 am

Re: Wii SDL Requiring OpenGX When OpenGL Disabled

Post by Deltaresero » Sat Sep 07, 2024 3:22 pm

Thanks for the clarification, and I appreciate you looking into the issue. I'm glad to hear it’s just a simple matter of missing #ifdef guards in the SDL 1.2 code. One other concern I have is with the SDL 2 branch, where a similar OpenGL support patch was introduced via ogc: add OpenGL 1.1 support via opengx (#74). At a quick glance, SDL 2 does seem to be better guarded, but I suspect it could still be facing a similar issue, especially since others working on their SRB2 port have suddenly found they need OpenGX. It might be worth double-checking if everything is properly guarded there too.

Regarding package updates, I was relying on Garuda Linux’s Pacman to keep the devkitPro packages up to date, but I only got the SYS_Report change at the beginning of the week with the release of OpenGX v0.9.0. Should we be manually updating devkitPro tools more frequently, or is Pacman expected to handle these updates through regular system updates?


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest