GSDL::AssetManager
Constants
This FormatCode must match the FormatCode in src/packer.cr
but we shouldn't include src/packer.cr in GDSL code
otherwise it will pack the assets everytime GSDL is required,
instead the GSDL consumer should manually pack assets using the
provided gsdl-packer tool specified in the README, installed via:
crystal lib/game_sdl/install_gsdl_tools.cr
Class methods
Closes the opened packfile. Should be called when all assets are loaded in release mode, or on application exit
Loads the assets.pack file and parses its manifest. The packfile is kept open for subsequent asset loading. should only be called in release mode
Reads raw byte data for a given path_key from the loaded packfile. Returns a Bytes object.
Loads raw data from the asset pack and then creates an SDL3::IOStream from raw byte data. This loads the entire asset into memory before passing it to SDL3. Suitable for smaller to medium-sized assets.