Top |
If you wish your program to load its resources from a Blorb file, you need to
find and open that file in your startup code.
(See Startup Options.)
Each platform will have appropriate functions available for finding startup
data.
Be sure to open the file in binary mode, not text mode.
Once you have opened the file as a Glk stream, pass it to
giblorb_set_resource_map()
.
If you do not call giblorb_set_resource_map()
in your startup code, or if it
fails, the library is left to its own devices for finding resources. Some
libraries may try to load resources from individual files —
PIC1
, PIC2
, PIC3
, and so on.
(See the Blorb specification for more on this approach.)
Other libraries will not have any other loading mechanism at all; no
resources will be available.
giblorb_err_t
giblorb_set_resource_map (strid_t file
);
This function tells the library that the file is indeed the Blorby source
of all resource goodness. Whenever your program calls an image or sound
function, such as glk_image_draw()
, the library will search this file for
the resource you request.
Do not close the stream after calling this function. The library is responsible for closing the stream at shutdown time.
giblorb_map_t *
giblorb_get_resource_map (void
);
This function returns the current resource map being used. Returns NULL
if giblorb_set_resource_map()
has not been called yet.