Maelstrom: Add the window title to the FrameBuf init parameters

From 674d51f23a71a5048672aa12993958e0f38c54b6 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 14 Mar 2026 08:16:23 -0700
Subject: [PATCH] Add the window title to the FrameBuf init parameters

---
 game/init.cpp              | 3 +--
 screenlib/SDL_FrameBuf.cpp | 6 +++---
 screenlib/SDL_FrameBuf.h   | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/game/init.cpp b/game/init.cpp
index b21e34ec..1499f5ab 100644
--- a/game/init.cpp
+++ b/game/init.cpp
@@ -789,11 +789,10 @@ int DoInitializations(Uint32 window_flags)
 	if (!InitResolutions(w, h)) {
 		return(-1);
 	}
-	if (screen->Init(w, h, window_flags, icon) < 0){
+	if (screen->Init(w, h, window_flags, "Maelstrom", icon) < 0){
 		error("Fatal: %s\n", screen->Error());
 		return(-1);
 	}
-	screen->SetCaption("Maelstrom");
 	SDL_DestroySurface(icon);
 
 	/* Get startup events, which shows the window on Mac OS X */
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
index 693a6f1e..5306a2ea 100644
--- a/screenlib/SDL_FrameBuf.cpp
+++ b/screenlib/SDL_FrameBuf.cpp
@@ -37,7 +37,7 @@ FrameBuf::FrameBuf() : ErrorBase()
 }
 
 int
-FrameBuf::Init(int width, int height, Uint32 window_flags, SDL_Surface *icon)
+FrameBuf::Init(int width, int height, Uint32 window_flags, const char *title, SDL_Surface *icon)
 {
 	int window_width = width;
 	int window_height = height;
@@ -54,7 +54,7 @@ FrameBuf::Init(int width, int height, Uint32 window_flags, SDL_Surface *icon)
 	}
 
 	/* Create the window */
-	m_window = SDL_CreateWindow(NULL, window_width, window_height, window_flags);
+	m_window = SDL_CreateWindow(title, window_width, window_height, window_flags);
 	if (!m_window) {
 		SetError("Couldn't create %dx%d window: %s", 
 					width, height, SDL_GetError());
@@ -62,7 +62,7 @@ FrameBuf::Init(int width, int height, Uint32 window_flags, SDL_Surface *icon)
 	}
 
 	/* Set the icon, if any */
-	if ( icon ) {
+	if (icon) {
 		SDL_SetWindowIcon(m_window, icon);
 	}
 
diff --git a/screenlib/SDL_FrameBuf.h b/screenlib/SDL_FrameBuf.h
index d7cfc0d4..ff3c70db 100644
--- a/screenlib/SDL_FrameBuf.h
+++ b/screenlib/SDL_FrameBuf.h
@@ -45,7 +45,7 @@ class FrameBuf : public ErrorBase {
 
 public:
 	FrameBuf();
-	int Init(int width, int height, Uint32 window_flags, SDL_Surface *icon = NULL);
+	int Init(int width, int height, Uint32 window_flags, const char *title = nullptr, SDL_Surface *icon = nullptr);
 	virtual ~FrameBuf();
 
 	/* Setup routines */