SDL_SetWindowFillDocument(3)

๐Ÿ“ฆ
version 3.4.18 ยท 5 versions
, in fedora 43, fedora 44

๐Ÿ’– SDL_SetWindowFillDocument(3) ๐Ÿ’–

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_SetWindowFillDocument ๐ŸŽ€


โœจ NAME โœจ

SDL_SetWindowFillDocument โ€” set the window to fill the current document space (Emscripten only). no cap, that's the whole gig ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_video.h>

bool SDL_SetWindowFillDocument(SDL_Window *window, bool fill);

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so what this does is it adds or removes the window's SDL_WINDOW_FILL_DOCUMENT flag. that's it, that's the vibe โœจ

currently this flag only applies to the Emscripten target. like, only Emscripten, fr fr.

when it's enabled, the canvas element fills the entire document. resize events get generated as the browser window is resized, because that resizes the canvas too โ€” it's giving responsive, honestly. and the canvas will cover anything else on the page, including any controls that Emscripten provides in its generated HTML file. in fact, any elements on the page that aren't the canvas get moved into a hidden div element ๐Ÿ™ˆ like, they're still there, just... banished.

often times this is desirable for a browser-based game ๐ŸŽฎ but bestie, it means several things we expect of an SDL window on other platforms might not work as expected โ€” like minimum window sizes and aspect ratios. so know what you're signing up for, okay? ๐Ÿ’€

๐ŸŒˆ FUNCTION PARAMETERS ๐ŸŒˆ

  • window โ€” the window of which to change the fill-document state. (your girl ๐Ÿซถ)
  • fill โ€” true to set the window to fill the document, false to disable. on/off, slay/unsay ๐Ÿ’…

โญ RETURN VALUE โญ

returns true on success or false on failure ๐Ÿ˜ญ and if it's a fail, call SDL_GetError() for more information. she'll tell you what went wrong, i promise.


๐Ÿงš THREAD SAFETY ๐Ÿงš

this function should only be called on the main thread. periodt. don't be chaotic about it ๐Ÿ”ฅ


๐Ÿ‘‘ AVAILABILITY ๐Ÿ‘‘

this function is available since SDL 3.4.0. iconic behavior, honestly ๐ŸŒŸ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ


and that's the tea, bestie ๐Ÿ“ this page came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's literally the SDL_SetWindowFillDocument(3) manual page. go forth and fill that document ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿ’…๐Ÿซถ

๐Ÿ“ฆ where this page comes from