SDL_SetWindowFullscreen(3)
π SDL_SetWindowFullscreen(3) π
okay bestie, we're in the SDL3 FUNCTIONS section of the manual and today's main character is SDL_SetWindowFullscreen β the little function that asks your window to go fullscreen (or, like, un-go fullscreen). she's giving "politely requesting, not demanding" and honestly? iconic. π«Ά
β¨ NAME β¨
SDL_SetWindowFullscreen β request that the window's fullscreen state be changed. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
bool SDL_SetWindowFullscreen(SDL_Window *window, bool fullscreen);
look at her. two params. no drama. slay. π
π DESCRIPTION π
so here's the tea, bestie. by default, a window in fullscreen state uses borderless fullscreen desktop mode β no exclusive grab, just vibes. but if you want a specific exclusive display mode instead, you set that with SDL_SetWindowFullscreenMode(). that's the separate-function situation, not this one. π₯
also, lowkey important: on some windowing systems this request is asynchronous, which means the new fullscreen state may not have been applied immediately upon the return of this function. like, she said "yes" but the windowing system is still getting ready. π if you genuinely need an immediate change, call SDL_SyncWindow() to block until the changes have taken effect. no cap.
when the window state actually changes, an SDL_EVENT_WINDOW_ENTER_FULLSCREEN or an SDL_EVENT_WINDOW_LEAVE_FULLSCREEN event will be emitted. so keep an eye on your event queue, she's talking to you. π
and remember β as this is just a request, it can be denied by the windowing system. not every ask gets a yes, and that's not a you problem. π
π FUNCTION PARAMETERS π
windowβ the window to change. yes, the one. your special little guy.fullscreenβtruefor fullscreen mode,falsefor windowed mode. binary queen. β
π RETURN VALUE π
returns true on success or false on failure. and if it fails, call SDL_GetError() for more information β she will absolutely tell you what went wrong. π
π§ THREAD SAFETY π§
this function should only be called on the main thread. do not try her on a worker thread. she is not that kind of girl. periodt. π
β AVAILABILITY β
this function is available since SDL 3.2.0. if you're on something older, bestie, it's giving "not invited to the party". π
π₯ SEE ALSO π₯
SDL_GetWindowFullscreenMode(3)SDL_SetWindowFullscreenMode(3)SDL_SyncWindow(3)SDL_WINDOW_FULLSCREEN(3)
the whole friend group. go read them too, iykyk. π
okay that's the whole page, you ate it, you understood it, and honestly? proud of you. this was Simple Directmedia Layer, SDL 3.4.18, and SDL_SetWindowFullscreen(3) β sending you fullscreen main character energy, mwah πβ¨π
π¦ 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