SDL_MaximizeWindow(3)
π SDL_MaximizeWindow π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, page SDL_MaximizeWindow(3), and lemme tell you β this one is SO simple and SO cute. it's literally just "make my window BIG". that's it. that's the whole vibe. π¦
β¨ NAME β¨
SDL_MaximizeWindow β request that the window be made as large as possible. no cap, that's the entire job description. π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_video.h>
bool SDL_MaximizeWindow(SDL_Window *window);
β¨ DESCRIPTION β¨
okay so first thing, and this is important, so listen up: non-resizable windows can't be maximized. if your window doesn't have the SDL_WINDOW_RESIZABLE flag set, this function is giving absolutely nothing. no effect. zero. nada. π so set that flag, bestie.
second thing β on some windowing systems this request is asynchronous, meaning the new window state may not have been applied immediately by the time this function returns. so if you need that change to already be done, like right now, call SDL_SyncWindow() to block until the changes have taken effect. it's giving "wait for me to finish". β³
when the window state actually changes, an SDL_EVENT_WINDOW_MAXIMIZED event will be emitted. πΈ but also β and this is the real tea β this is just a request, so the windowing system can straight up deny the state change. the window manager is the main character here, not you. π
and one more thing, bc it lowkey matters: when you're maximizing a window, whether the constraints you set via SDL_SetWindowMaximumSize() get honored depends on the policy of the window manager. Win32 and macOS enforce the constraints when maximizing, while X11 and Wayland window managers may vary. so like... it depends. iykyk. π
β¨ FUNCTION PARAMETERS β¨
windowβ the window to maximize. that's the one you want big, bestie. π
β¨ RETURN VALUE β¨
returns true on success or false on failure. and if it fails, go call SDL_GetError() for more information, because she WILL tell you what went wrong. π
β¨ THREAD SAFETY β¨
π¨ this function should only be called on the main thread. do not try it anywhere else. periodt.
β¨ AVAILABILITY β¨
this function is available since SDL 3.2.0. she's new-ish and she's thriving. β¨
β¨ SEE ALSO β¨
Simple Directmedia Layer Β· SDL 3.4.18 Β· and this lil page right here is SDL_MaximizeWindow(3). mwah, love u, go maximize something. π
ππ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms