[[tags: allegro game]]
== allegro
This document pertains to memory related methods found in the Allegro egg.
Please see the main [allegro] wiki page for more information.
[[toc:]]
== Records
=== memory-interface
memory-interface
(make-memory-interface*)
(make-memory-interface)
(free-memory-interface! memory-interface)
(memory-interface-malloc memory-interface)
(memory-interface-malloc-set! memory-interface (function c-pointer (integer32 integer (const c-string) (const c-string))))
(memory-interface-realloc memory-interface)
(memory-interface-realloc-set! memory-interface (function void (c-pointer integer (const c-string) (const c-string))))
(memory-interface-calloc memory-interface)
(memory-interface-calloc-set! memory-interface (function c-pointer (c-pointer integer32 integer (const c-string) (const c-string))))
(memory-interface-free memory-interface)
(memory-interface-free-set! memory-interface (function c-pointer (integer32 integer32 integer (const c-string) (const c-string))))
== Functions
=== Memory
(memory-interface-set! memory-interface)
Implements al_set_memory_interface.
(malloc* integer)
Implements al_malloc.
(malloc integer)
Implements al_malloc, with (free!) declared as a finalizer.
(free! ptr)
Implements al_free.
(realloc* ptr integer)
Implements al_realloc.
(realloc ptr integer)
Implements al_realloc, with (free!) declared as a finalizer.
(calloc* integer integer)
Implements al_calloc.
(calloc integer integer)
Implements al_calloc, with (free!) declared as a finalizer.
(malloc/context* (int size) (int line) (string file) (string function))
Implements al_malloc_with_context.
(malloc/context (int size) (int line) (string file) (string function))
Implements al_malloc_with_context, with (free/context!) declared as a finalizer.
(free/context! ptr (int line) (string file) (string function))
Implements al_free_with_context.
(realloc/context* ptr (int size) (int line) (string file) (string function))
Implements al_realloc_with_context.
(realloc/context ptr (int size) (int line) (string file) (string function))
Implements al_realloc_with_context, with (free/context!) declared as a finalizer.
(calloc/context* (int count) (int size) (int line) (string file) (string function))
Implements al_calloc_with_context.
(calloc/context (int count) (int size) (int line) (string file) (string function))
Implements al_calloc_with_context, with (free/context!) declared as a finalizer.
=== Memory Files
(open-memfile* (c-pointer mem) (unsigned-integer size) (string mode))
Implements al_open_memfile.
(open-memfile (c-pointer mem) (unsigned-integer size) (string mode))
Implements al_open_memfile, with (free&close-file!) declared as a finalizer.
(memfile-version)
Implements al_get_allegro_memfile_version.
=== Miscellaneous
(combine-flags converter flags)
For combining enum flags together, ie:
(combine-flags display-flag->int '(windowed opengl resizable generate-expose-events))
(make-id a b c d)
Implements AL_ID.
(run-main argc argv (function integer (integer (c-pointer c-string))))
Implements al_run_main.
(init-everything)
Initializes all sub-systems.
(init-symbol s)
Initializes sub-systems by symbol-name. Valid symbols are: allegro, audio, font, image, joystick, keyboard, mouse, primitives, and ttf.
(init-this arg)
Initializes sub-systems either by a single symbol or by a list of symbols. Ie:
(init-this (list 'allegro 'audio 'font 'image 'joystick 'keyboard 'mouse 'primitives 'ttf))
(uninstall-everything)
Attempts to uninitialize all loaded sub-systems.
(uninstall-this arg)
Attempts to uninitialize sub-systems by either a single symbol or by a list of symbols. Ie:
(uninstall-this (list 'system 'audio 'font 'image 'joystick 'keyboard 'mouse 'primitives 'ttf))