Rename functions in SDL_system.h to match SDL 3.0 naming convention

Fixes https://github.com/libsdl-org/SDL/issues/10277
This commit is contained in:
Sam Lantinga
2024-07-15 16:13:23 -07:00
parent e38f971f46
commit 54366181c3
32 changed files with 252 additions and 158 deletions

View File

@@ -169,10 +169,10 @@ them using the standard functions in SDL_iostream.h.
There are also a few Android specific functions that allow you to get other
useful paths for saving and loading data:
* SDL_AndroidGetInternalStoragePath()
* SDL_AndroidGetExternalStorageState()
* SDL_AndroidGetExternalStoragePath()
* SDL_AndroidGetCachePath()
* SDL_GetAndroidInternalStoragePath()
* SDL_GetAndroidExternalStorageState()
* SDL_GetAndroidExternalStoragePath()
* SDL_GetAndroidCachePath()
See SDL_system.h for more details on these functions.

View File

@@ -28,10 +28,10 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers
* An implementation on `WinMain` that performs the above GDK setup that you can use by #include'ing SDL_main.h in the source file that includes your standard main() function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. To use `SDL_RunApp`, `#define SDL_MAIN_HANDLED` before `#include <SDL3/SDL_main.h>`.
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
* You can get the handle of the global task queue through `SDL_GetGDKTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
* Single-player games have some additional features available:
* Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
* Call `SDL_GetGDKDefaultUser` to get the default XUserHandle pointer.
* `SDL_GetPrefPath` still works, but only for single-player titles.
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!

View File

@@ -225,7 +225,7 @@ Game Center
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
int SDL_iOSSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
int SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
@@ -247,7 +247,7 @@ e.g.
// Set up the game to run in the window animation callback on iOS
// so that Game Center and so forth works correctly.
SDL_iOSSetAnimationCallback(window, 1, ShowFrame, NULL);
SDL_SetiOSAnimationCallback(window, 1, ShowFrame, NULL);
#else
while ( running ) {
ShowFrame(0);
@@ -258,7 +258,7 @@ e.g.
}
Note that if you are using main callbacks instead of a standard C main() function, your SDL_AppIterate() callback is already doing this and you don't need to use SDL_iOSSetAnimationCallback.
Note that if you are using main callbacks instead of a standard C main() function, your SDL_AppIterate() callback is already doing this and you don't need to use SDL_SetiOSAnimationCallback.
Deploying to older versions of iOS

View File

@@ -1748,23 +1748,36 @@ The following symbols have been renamed:
SDL_WindowsMessageHook has changed signatures so the message may be modified and it can block further message processing.
SDL_AndroidGetExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error.
SDL_GetAndroidExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error.
SDL_AndroidRequestPermission is no longer a blocking call; the caller now provides a callback function that fires when a response is available.
SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_iOSSetAnimationCallback() and SDL_iOSSetEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option.
SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_SetiOSAnimationCallback() and SDL_SetiOSEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option.
The following functions have been removed:
* SDL_RenderGetD3D11Device() - replaced with the "SDL.renderer.d3d11.device" property
* SDL_RenderGetD3D12Device() - replaced with the "SDL.renderer.d3d12.device" property
* SDL_RenderGetD3D9Device() - replaced with the "SDL.renderer.d3d9.device" property
* SDL_WinRTGetFSPathUNICODE() - Use SDL_WinRTGetFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16.
* SDL_GetWinRTFSPathUNICODE() - Use SDL_GetWinRTFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16.
The following functions have been renamed:
* SDL_WinRTGetFSPathUTF8() => SDL_WinRTGetFSPath()
* SDL_iPhoneSetAnimationCallback() => SDL_iOSSetAnimationCallback()
* SDL_iPhoneSetEventPump() => SDL_iOSSetEventPump()
* SDL_AndroidGetActivity() => SDL_GetAndroidActivity()
* SDL_AndroidGetExternalStoragePath() => SDL_GetAndroidExternalStoragePath()
* SDL_AndroidGetExternalStorageState() => SDL_GetAndroidExternalStorageState()
* SDL_AndroidGetInternalStoragePath() => SDL_GetAndroidInternalStoragePath()
* SDL_AndroidGetJNIEnv() => SDL_GetAndroidJNIEnv()
* SDL_Direct3D9GetAdapterIndex() => SDL_GetDirect3D9AdapterIndex()
* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser()
* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue()
* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority()
* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy()
* SDL_WinRTGetDeviceFamily() => SDL_GetWinRTDeviceFamily()
* SDL_GetWinRTFSPathUTF8() => SDL_GetWinRTFSPath()
* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback()
* SDL_iOSSetEventPump() => SDL_SetiOSEventPump()
* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback()
* SDL_iPhoneSetEventPump() => SDL_SetiOSEventPump()
## SDL_syswm.h

View File

@@ -129,7 +129,7 @@ SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by:
(and which require less work to use safely, in terms of data integrity).
Apps that wish to get their Roaming folder's path can do so either by using
SDL_WinRTGetFSPath(), or directly through the WinRT class,
SDL_GetWinRTFSPath(), or directly through the WinRT class,
Windows.Storage.ApplicationData.