The Blorb LayerThe Blorb Layer — Loading resources from a Blorb file |
The material described in this section is not part of the Glk API per se. It is an external layer which allows the library to load resources (images and sounds) from a file specified by your program. The Blorb file format is a standard IF resource archive.
The Glk spec does not require that resources be stored in a Blorb file. It says only that the library knows how to load them and use them, when you so request. However, Blorb is the recommended way to supply portable resources. Most Glk libraries will support Blorb, using the interface defined in this section.
The quick summary: resources are identified by type (image, sound, etc) and by an index number.
But not by name. This is for historical reasons; Infocom's Z-machine architecture used this scheme.
For the complete Blorb specification and tools for Blorb file manipulation, see: http://eblong.com/zarf/blorb/
The Blorb layer is implemented in a C source file, gi_blorb.c
, and its header, gi_blorb.h
. This code is (mostly) platform-independent — it is identical in every library, just as the glk.h
header file is identical in every library. Each library author who wants to support Blorb should download the gi_blorb.c
and gi_blorb.h
files from the Glk web site, and compile them unchanged into the library.
Most of the functions defined in gi_blorb.h
are intended for the library. If you are writing a Glk program, you can ignore them all, except for giblorb_set_resource_map()
; see What the Program Does. If you are implementing a Glk library, you can use this API to find and load resource data.