SDL_SetWindowTitle(3)

πŸ’– SDL_SetWindowTitle(3) β€” the SDL3 functions glow-up ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_SetWindowTitle πŸ’…


🌸 NAME 🌸

SDL_SetWindowTitle β€” sets the title of a window, no cap πŸͺŸβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_video.h>

bool SDL_SetWindowTitle(SDL_Window *window, const char *title);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is literally just "name your window" energy πŸ’– you hand it a string and it becomes the title. and the tea is: that string is expected to be in UTF-8 encoding 🫢 so don't come at it with some random encoding, it's giving UTF-8 or nothing fr fr.


✨ FUNCTION PARAMETERS ✨

  • window β€” the window to change πŸ‘‘ this is your victim, the one getting a new name.
  • title β€” the desired window title, in UTF-8 format 🌈 yes, exactly like the description said. consistency slay.

πŸ’œ RETURN VALUE πŸ’œ

Returns true on success or false on failure πŸ₯² and if it's a flop, call SDL_GetError() for more information β€” that's your group chat debrief on what went wrong 😭


πŸ”₯ THREAD SAFETY πŸ”₯

This function should only be called on the main thread. periodt. πŸ’… don't be out here calling it from some random thread, that's not the vibe.

⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0 πŸŽ‰ so if you're on anything older... bestie. upgrade. πŸ™ˆ


🌈 SEE ALSO 🌈

  • SDL_GetWindowTitle(3) β€” the read-only sibling, for when you wanna know what the title currently is 🧚

and that's the whole page, you ate it, go forth and rename your windows πŸ“

mwah πŸ’‹ this came to you from Simple Directmedia Layer, running SDL 3.4.18 β€” stay iconic, bestie πŸ‘‘

πŸ“¦ where this page comes from