From 19758eb15d1e28500ad02bb7bd70fe528a65ca0d Mon Sep 17 00:00:00 2001
From: Christmas-Missionary
<156368675+Christmas-Missionary@users.noreply.github.com>
Date: Sat, 15 Aug 2026 04:00:25 +0000
Subject: [PATCH] SDL_VideoInit to SDL_InitVideo
- Refers to SDL3 internal function, NOT SDL2 public function
- FIXME comment is removed as naming convention is established
---
src/SDL.c | 2 +-
src/audio/SDL_audio.c | 1 -
src/video/SDL_video.c | 2 +-
src/video/SDL_video_c.h | 6 +++---
src/video/cocoa/SDL_cocoavideo.m | 2 +-
5 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/SDL.c b/src/SDL.c
index 3c5c198aa345a..acb863f300cd1 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -420,7 +420,7 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
SDL_assert(SDL_VideoThreadID == SDL_MainThreadID);
#endif
- if (!SDL_VideoInit(NULL)) {
+ if (!SDL_InitVideo(NULL)) {
SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
SDL_PushError();
SDL_QuitSubSystem(SDL_INIT_EVENTS);
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index c69a5a418ad1f..43a71e653266a 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -949,7 +949,6 @@ static Uint32 SDLCALL HashAudioDeviceID(void *userdata, const void *key)
return ((Uint32) ((uintptr_t) key)) >> 2;
}
-// !!! FIXME: the video subsystem does SDL_VideoInit, not SDL_InitVideo. Make this match.
bool SDL_InitAudio(const char *driver_name)
{
if (SDL_GetCurrentAudioDriver()) {
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 4ea43ae23d299..f2fc1dc325946 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -616,7 +616,7 @@ const char *SDL_GetVideoDriver(int index)
/*
* Initialize the video and event subsystems -- determine native pixel format
*/
-bool SDL_VideoInit(const char *driver_name)
+bool SDL_InitVideo(const char *driver_name)
{
SDL_VideoDevice *video;
bool init_events = false;
diff --git a/src/video/SDL_video_c.h b/src/video/SDL_video_c.h
index e2a934614e6cf..4a7c419148976 100644
--- a/src/video/SDL_video_c.h
+++ b/src/video/SDL_video_c.h
@@ -37,7 +37,7 @@ struct SDL_VideoDevice;
* either SDL_Init() or SDL_InitSubSystem(), you should call SDL_VideoQuit()
* before calling SDL_Quit().
*
- * It is safe to call this function multiple times. SDL_VideoInit() will call
+ * It is safe to call this function multiple times. SDL_InitVideo() will call
* SDL_VideoQuit() itself if the video subsystem has already been initialized.
*
* You can use SDL_GetNumVideoDrivers() and SDL_GetVideoDriver() to find a
@@ -48,10 +48,10 @@ struct SDL_VideoDevice;
* \returns true on success or false on failure; call
* SDL_GetError() for more information.
*/
-extern bool SDL_VideoInit(const char *driver_name);
+extern bool SDL_InitVideo(const char *driver_name);
/**
- * Shut down the video subsystem, if initialized with SDL_VideoInit().
+ * Shut down the video subsystem, if initialized with SDL_InitVideo().
*
* This function closes all windows, and restores the original video mode.
*/
diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m
index 081e162be0920..b0a8b6945d175 100644
--- a/src/video/cocoa/SDL_cocoavideo.m
+++ b/src/video/cocoa/SDL_cocoavideo.m
@@ -61,7 +61,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device)
SDL_CocoaVideoData *data;
if (![NSThread isMainThread]) {
- return NULL; // this doesn't SDL_SetError() because SDL_VideoInit is just going to overwrite it.
+ return NULL; // this doesn't SDL_SetError() because SDL_InitVideo is just going to overwrite it.
}
Cocoa_RegisterApp();