Migrating from SDL2 to SDL3

Dear Sir,

I am having great difficulty in doing the above!

I’ve tried using the .cocci file as explained in the Quake port upgrade example but haven’t had any success.

I’ve tried using the .py scripts - no luck either.

By way of information, I have noticed the the .py scripts have significant size discrepancies between the ones in the 3.4.0 zip files and the ones downloadable from the Wiki page directly.

Any help would be greatly appreciated.

Kind regards,

Ashley Farnham

So what problems are you having? The scripts only seems to deal with name changes and simple transformations …

SDL/build-scripts/SDL_migration.cocci at main · libsdl-org/SDL · GitHub
It generates a patch that you can apply to your project to build for SDL3. It does not
handle conceptual API changes, but it automates API name changes and function parameter
transformations.

… but there are probably many other changes that you need to do to make it work.

Dear Peter87,

Thanks for your reply.

The problems I have can be summarised as follows:

Unfortunately:

  1. When I run the .py scripts, they just don’t do anything.

  2. There is a considerable variation between the .py scripts that come with the downloadable zips, and the scripts that are referenced in the link you’ve kindly posted. Even those scripts don’t work either.

  3. The .cocci file doesn’t do anything at all even when I follow the example in the Quake 3 port.

I am completely stuck!

Kind regards,

Ashley Farnham

Do you run them with arguments as described in the migration guide?
E.g.

rename_symbols.py --all-symbols source_code_path

The scripts rename_symbols.py, rename_headers.py and rename_macros.py linked from the migration guide are identical to the ones found in SDL3-3.4.0.zip (inside the build-scripts directory).

I’m not familiar with Quake 3 port. Did you follow the instructions at the top of the .cocci file all the way to the “Apply the patch to your project” part?


I’m just trying to help. I have not actually used these scripts myself.

Yes, I run the .py scripts with the appropriate arguments.

I have also done the “Apply patch to your project” bit - no luck.