FILAMENT-RESGEN(1)

🌸 FILAMENT-RESGEN(1) 🌸

okay so bestie, welcome to filament-resgen(1) β€” it lives in the User Commands part of the manual, and it's literally the filament material tools page. grab a snack, we're doing this πŸ’…


✨ NAME ✨

filament-resgen β€” filament material tools. that's it, that's the name section, she's short and she's iconic πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so filament-resgen takes a whole lil sequence of binary blobs and aggregates them, and each one of those blobs becomes a "resource" β€” and the resource's id? it's literally just the basename of the input file. no cap. 🫢

and then it produces this whole set of files, and yes I'm listing every single one because we don't do skipping here:

  • resources.h β€” declares sizes and offsets for each resource
  • resources.S β€” a small assembly file with an incbin directive and a rodata section
  • resources.apple.S β€” ditto, but with a different rodata name and underscore prefixes
  • resources.bin β€” the aggregated binary blob that the incbin actually refers to

🧚 Usage:

filament-resgen [options] <input_file_0> <input_file_1> ...

like, you give it options, then you give it files, and it eats them all up 🌈


πŸ’– OPTIONS πŸ’–

okay here's the menu, every single flag, zero crumbs left behind:

  • --help, -h β€” Print this message
  • --license, -L β€” Print copyright and license information
  • --package=string, -p string β€” Name of the resource package (defaults to "resources"). This is used to generate filenames and symbol prefixes
  • --deploy=dir, -x dir (defaults to ".") β€” Generate everything needed for deployment into <dir>
  • --keep, -k β€” Keep file extensions when generating symbols
  • --text, -t β€” Append a null terminator to each data blob
  • --cfile, -c β€” Generate xxd-style C file (useful for WebAssembly)
  • --json, -j β€” Embed a JSON string in the output that provides a summary of all resource sizes and names. Useful for size analysis.
  • --quiet, -q β€” Suppress console output
  • --help, -h β€” Print this message
  • --license, -L β€” Print copyright and license information
  • --package=string, -p string β€” Name of the resource package (defaults to "resources"). This is used to generate filenames and symbol prefixes
  • --deploy=dir, -x dir (defaults to ".") β€” Generate everything needed for deployment into <dir>
  • --keep, -k β€” Keep file extensions when generating symbols
  • --text, -t β€” Append a null terminator to each data blob
  • --cfile, -c β€” Generate xxd-style C file (useful for WebAssembly)
  • --json, -j β€” Embed a JSON string in the output that provides a summary of all resource sizes and names. Useful for size analysis.
  • --quiet, -q β€” Suppress console output
not me pointing out that the page says all of that twice β€” and bestie, I'm not skipping a single crumb of it, so here it is again, the whole thing, twice as much slay πŸ’€

πŸ”₯ EXAMPLES πŸ”₯

resgen -cp textures jungle.png beach.png
> Generated files: textures.h, textures.S, textures.apple.S, textures.bin, textures.c
> Generated symbols: TEXTURES_JUNGLE_DATA, TEXTURES_JUNGLE_SIZE,
TEXTURES_BEACH_DATA, TEXTURES_BEACH_SIZE

look at her go 😭 -cp = cfile + package, and boom, files and symbols, main character energy fr fr πŸ‘‘

and then the page just... says the whole thing again. so here's round two, verbatim, no edits:

resgen aggregates a sequence of binary blobs, each of which becomes a "resource" whose id is the basename of the input file. It produces the following set of files:

  • resources.h β€” declares sizes and offsets for each resource
  • resources.S β€” small assembly file with incbin directive and rodata section
  • resources.apple.S β€” ditto but with different rodata name and underscore prefixes
  • resources.bin β€” the aggregated binary blob that the incbin refers to

🌈 Usage:

resgen [options] <input_file_0> <input_file_1> ...
resgen -cp textures jungle.png beach.png
> Generated files: textures.h, textures.S, textures.apple.S, textures.bin, textures.c
> Generated symbols: TEXTURES_JUNGLE_DATA, TEXTURES_JUNGLE_SIZE,
TEXTURES_BEACH_DATA, TEXTURES_BEACH_SIZE

iykyk πŸ’œ


ok that's the whole page, every flag, every file, every symbol, nothing dropped, periodt πŸŽ€

and the cute sign-off, bestie: this one's from resgen, dated October 2021, sitting in the FILAMENT-RESGEN(1) spot in the manual. bye ilysm, go aggregate something pretty βœ¨πŸ¦‹πŸ’–