From fd0631fd3549ac3f43725dc327d11bbdbb138e9c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Dec 2022 15:58:15 -0800 Subject: [PATCH] Added documentation for rename_symbols.py --- docs/README-migration.md | 11 +++++++++-- include/SDL3/SDL_oldnames.h | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index b344398775..a3bc66438d 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -2,10 +2,17 @@ This guide provides useful information for migrating applications from SDL 2.0 to SDL 3.0. -We have provided a handy Python script to automate some of this work for you [link to script], and details on the changes are organized by SDL 2.0 header below. +Details on API changes are organized by SDL 2.0 header below. + +We have provided a handy Python script [rename_symbols.py](https://github.com/libsdl-org/SDL/blob/main/build-scripts/rename_symbols.py) to rename SDL2 functions to their SDL3 counterparts: +```sh +rename_symbols.py --all-symbols source_code_path +``` SDL headers should now be included as `#include `. Typically that's the only header you'll need in your application unless you are using OpenGL or Vulkan functionality. +The file with your main() function should also include , see below in the SDL_main.h section. + CMake users should use this snippet to include SDL support in their project: ``` find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) @@ -26,7 +33,7 @@ LDFLAGS += $(shell pkg-config sdl3 --libs) The SDL3test library has been renamed SDL3_test. -There is no static SDLmain library anymore, it's now header-only, see below in the SDL_main.h section. +There is no SDLmain library anymore, it's now header-only, see below in the SDL_main.h section. begin_code.h and close_code.h in the public headers have been renamed to SDL_begin_code.h and SDL_close_code.h. These aren't meant to be included directly by applications, but if your application did, please update your `#include` lines. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 093cfd1872..8db90ab221 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -31,6 +31,9 @@ /* The new function names are recommended, but if you want to have the * old names available while you are in the process of migrating code * to SDL3, you can define `SDL_ENABLE_OLD_NAMES` in your project. + * + * You can use https://github.com/libsdl-org/SDL/blob/main/build-scripts/rename_symbols.py to mass rename the symbols defined here in your codebase: + * rename_symbols.py --all-symbols source_code_path */ #ifdef SDL_ENABLE_OLD_NAMES