From 74697bc35188d276dcae3c46d7ac10ffa982ab2f Mon Sep 17 00:00:00 2001
From: Lokathor <[EMAIL REDACTED]>
Date: Mon, 23 Jan 2023 23:04:43 -0700
Subject: [PATCH] group init flag defines into an enum (#7137)
---
include/SDL3/SDL_init.h | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/include/SDL3/SDL_init.h b/include/SDL3/SDL_init.h
index 7e49f790a7b5..d4d149915ead 100644
--- a/include/SDL3/SDL_init.h
+++ b/include/SDL3/SDL_init.h
@@ -39,25 +39,32 @@ extern "C" {
/* As of version 0.5, SDL is loaded dynamically into the application */
/**
- * \name SDL_INIT_*
+ * \brief Initialization flags for SDL_Init and/or SDL_InitSubSystem
*
- * These are the flags which may be passed to SDL_Init(). You should
- * specify the subsystems which you will be using in your application.
+ * These are the flags which may be passed to SDL_Init(). You should
+ * specify the subsystems which you will be using in your application.
+ *
+ * \sa SDL_Init
+ * \sa SDL_Quit
+ * \sa SDL_InitSubSystem
+ * \sa SDL_QuitSubSystem
+ * \sa SDL_WasInit
*/
-/* @{ */
-#define SDL_INIT_TIMER 0x00000001u
-#define SDL_INIT_AUDIO 0x00000010u
-#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
-#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
-#define SDL_INIT_HAPTIC 0x00001000u
-#define SDL_INIT_GAMEPAD 0x00002000u /**< SDL_INIT_GAMEPAD implies SDL_INIT_JOYSTICK */
-#define SDL_INIT_EVENTS 0x00004000u
-#define SDL_INIT_SENSOR 0x00008000u
+typedef enum
+{
+ SDL_INIT_TIMER = 0x00000001,
+ SDL_INIT_AUDIO = 0x00000010,
+ SDL_INIT_VIDEO = 0x00000020, /**< `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS` */
+ SDL_INIT_JOYSTICK = 0x00000200, /**< `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` */
+ SDL_INIT_HAPTIC = 0x00001000,
+ SDL_INIT_GAMEPAD = 0x00002000, /**< `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` */
+ SDL_INIT_EVENTS = 0x00004000,
+ SDL_INIT_SENSOR = 0x00008000
+} SDL_InitFlags;
#define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMEPAD | SDL_INIT_SENSOR \
)
-/* @} */
/**
* Initialize the SDL library.