Re: [hatari-devel] SDL3

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Sun, 2 Feb 2025 20:54:01 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> On 2.2.2025 11.01, Andreas Grabher wrote:
> >> Am 06.10.2024 um 10:53 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:  
> > Now that SDL3 has been released I thought it is time to send another update to my patch. I think from here on there won’t be much changes. I have been running Previous with SDL3 only for quite some time now and it seems to work very well (better than SDL2). For not breaking things for those using systems with slow upgrades it would make sense to create a separate SDL3 branch.  
> 
> Thanks!
> 
> IMHO having both SDL2 & SDL3 support in same branch, and just building 
> Hatari for the SDL version available on the system, would be better.
> 
> It seems that most of the changes could be handled with appropriate 
> defines mapping the SDL2 function & define names to ones used by SDL3.

Yes, but they also changed e.g. the return code of functions, see e.g. this
part of the patch:

 	/* Init the SDL's audio subsystem: */
 	if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
-		if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
+		if (SDL_InitSubSystem(SDL_INIT_AUDIO) == false) {
 			Log_Printf(LOG_WARN, "[Audio] Could not init audio input: %s\n", SDL_GetError());
 			Statusbar_AddMessage("Error: Can't open SDL audio subsystem.", 5000);
 			return;
 		}
 	}

That's quite ugly, not sure how to handle that for both SDL versions at the
same time without lots of ugly #ifdefs ... :-(

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/