1 Raylib Support
(require raylib/support) | package: raylib |
Various utilities to make interfacing with Raylib nicer.
syntax
(_pointer-to type)
This just returns _pointer, but is more helpful for documentation.
syntax
(define-ptr name type value)
type must evaluate to an appropriate ctype?, and values will be converted to and from this whenever name is referenced or set!.
syntax
(borrow var)
cleanup is added as a finalizer for value, such that it is called with value when it is about to be garbage collected, or under other similar conditions.
See allocator for more details on behavior. Notably, a second call to attach-cleanup overwrites the original cleanup procedure.
procedure
(call-with-cleanup cleanup value proc) → any
cleanup : (-> any/c any) value : any/c proc : (-> any/c any)
This also installs a continuation barrier by call-with-continuation-barrier, to prevent continuation jumps back into proc, so cleanup doesn’t get called more than once.
syntax
(let*-with-cleanup ([name cleanup value] ...) body ...)
call-with-cleanup is called for each binding, ensuring that each cleanup procedure is called at most once, and that it is called even if a following value expression throws an exception or escapes otherwise. Notably this also introduces a continuation barrier for each binding.
value
Use this if you want to redefine any functions to better suit your application. The alternative is to use (ffi-lib #f) after requiring this module.