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

@@ -356,8 +356,8 @@ typedef struct SDL_MouseWheelEvent
float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
float mouseX; /**< X coordinate, relative to window */
float mouseY; /**< Y coordinate, relative to window */
float mouse_x; /**< X coordinate, relative to window */
float mouse_y; /**< Y coordinate, relative to window */
} SDL_MouseWheelEvent;
/**
@@ -535,8 +535,8 @@ typedef struct SDL_TouchFingerEvent
Uint32 type; /**< ::SDL_EVENT_FINGER_MOTION or ::SDL_EVENT_FINGER_DOWN or ::SDL_EVENT_FINGER_UP */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_TouchID touchId; /**< The touch device id */
SDL_FingerID fingerId;
SDL_TouchID touchID; /**< The touch device id */
SDL_FingerID fingerID;
float x; /**< Normalized in the range 0...1 */
float y; /**< Normalized in the range 0...1 */
float dx; /**< Normalized in the range -1...1 */

View File

@@ -178,9 +178,9 @@ typedef enum
SDL_GAMEPAD_BINDTYPE_HAT
} SDL_GamepadBindingType;
typedef struct
typedef struct SDL_GamepadBinding
{
SDL_GamepadBindingType inputType;
SDL_GamepadBindingType input_type;
union
{
int button;
@@ -200,7 +200,7 @@ typedef struct
} input;
SDL_GamepadBindingType outputType;
SDL_GamepadBindingType output_type;
union
{
SDL_GamepadButton button;

View File

@@ -58,8 +58,8 @@ typedef enum
typedef struct
{
Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
const char * text; /**< The UTF-8 button text */
int buttonID; /**< User defined button id (value returned via SDL_ShowMessageBox) */
const char *text; /**< The UTF-8 button text */
} SDL_MessageBoxButtonData;
/**

View File

@@ -492,6 +492,9 @@
/* ##SDL_timer.h */
#define SDL_GetTicks64 SDL_GetTicks
/* ##SDL_version.h */
#define SDL_version SDL_Version
/* ##SDL_video.h */
#define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode
#define SDL_GetDisplayOrientation SDL_GetCurrentDisplayOrientation
@@ -961,6 +964,9 @@
/* ##SDL_timer.h */
#define SDL_GetTicks64 SDL_GetTicks64_renamed_SDL_GetTicks
/* ##SDL_version.h */
#define SDL_version SDL_version_renamed_SDL_Version
/* ##SDL_video.h */
#define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_renamed_SDL_GetCurrentDisplayOrientation

View File

@@ -703,8 +703,8 @@ typedef struct SDL_PixelFormat
{
Uint32 format;
SDL_Palette *palette;
Uint8 BitsPerPixel;
Uint8 BytesPerPixel;
Uint8 bits_per_pixel;
Uint8 bytes_per_pixel;
Uint8 padding[2];
Uint32 Rmask;
Uint32 Gmask;

View File

@@ -48,12 +48,12 @@ extern "C" {
* \sa SDL_VERSION
* \sa SDL_GetVersion
*/
typedef struct SDL_version
typedef struct SDL_Version
{
Uint8 major; /**< major version */
Uint8 minor; /**< minor version */
Uint8 patch; /**< update version */
} SDL_version;
} SDL_Version;
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
@@ -64,16 +64,16 @@ typedef struct SDL_version
/**
* Macro to determine SDL version program was compiled against.
*
* This macro fills in a SDL_version structure with the version of the
* This macro fills in an SDL_Version structure with the version of the
* library you compiled against. This is determined by what header the
* compiler uses. Note that if you dynamically linked the library, you might
* have a slightly newer or older version at runtime. That version can be
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
* is not a macro.
*
* \param x A pointer to a SDL_version struct to initialize.
* \param x A pointer to an SDL_Version struct to initialize.
*
* \sa SDL_version
* \sa SDL_Version
* \sa SDL_GetVersion
*/
#define SDL_VERSION(x) \
@@ -114,7 +114,7 @@ typedef struct SDL_version
*
* This function may be called safely at any time, even before SDL_Init().
*
* \param ver the SDL_version structure that contains the version information
* \param ver the SDL_Version structure that contains the version information
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
@@ -122,7 +122,7 @@ typedef struct SDL_version
*
* \sa SDL_GetRevision
*/
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_version * ver);
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_Version * ver);
/**
* Get the code revision of SDL that is linked against your program.