Updated structure and field names for consistency

Type names are camel case and field names are snake case except for fields ending in id, which are capitalized.

Fixes https://github.com/libsdl-org/SDL/issues/6955
This commit is contained in:
Sam Lantinga
2024-02-11 08:03:26 -08:00
parent 6f87973b9c
commit cacac6cc34
74 changed files with 499 additions and 366 deletions

View File

@@ -330,6 +330,10 @@ The SDL_EVENT_WINDOW_SIZE_CHANGED event has been removed, and you can use SDL_EV
The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor.
The mouseX and mouseY fields of SDL_MouseWheelEvent have been renamed mouse_x and mouse_y.
The touchId and fingerId fields of SDL_TouchFingerEvent have been renamed touchID and fingerID.
SDL_QUERY, SDL_IGNORE, SDL_ENABLE, and SDL_DISABLE have been removed. You can use the functions SDL_SetEventEnabled() and SDL_EventEnabled() to set and query event processing state.
SDL_AddEventWatch() now returns -1 if it fails because it ran out of memory and couldn't add the event watch callback.
@@ -504,6 +508,8 @@ SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_i
}
```
The inputType and outputType fields of SDL_GamepadBinding have been renamed input_type and output_type.
The following enums have been renamed:
* SDL_GameControllerAxis => SDL_GamepadAxis
* SDL_GameControllerBindType => SDL_GamepadBindingType
@@ -871,6 +877,10 @@ Several platform-specific entry point functions have been removed as unnecessary
#define SDL_GDKRunApp(MAIN_FUNC, RESERVED) SDL_RunApp(0, NULL, MAIN_FUNC, RESERVED)
```
## SDL_messagebox.h
The buttonid field of SDL_MessageBoxButtonData has been renamed buttonID.
## SDL_metal.h
SDL_Metal_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place.
@@ -912,6 +922,8 @@ The following symbols have been renamed:
SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)).
The BitsPerPixel and BytesPerPixel fields of SDL_PixelFormat have been renamed bits_per_pixel and bytes_per_pixel.
The following functions have been renamed:
* SDL_AllocFormat() => SDL_CreatePixelFormat()
* SDL_AllocPalette() => SDL_CreatePalette()
@@ -1528,6 +1540,9 @@ The following functions have been removed:
SDL_GetRevisionNumber() has been removed from the API, it always returned 0 in SDL 2.0.
The following structures have been renamed:
* SDL_version => SDL_Version
## SDL_video.h
Several video backends have had their names lower-cased ("kmsdrm", "rpi", "android", "psp", "ps2", "vita"). SDL already does a case-insensitive compare for SDL_HINT_VIDEO_DRIVER tests, but if your app is calling SDL_GetVideoDriver() or SDL_GetCurrentVideoDriver() and doing case-sensitive compares on those strings, please update your code.