I now understand what you're trying to do. Here is my take on it:
- Accessing a byte vector as C vector is compiler specific. A portable solution would allocate some memory using UFFI's interface to malloc, copy the data to that memory buffer using a lisp loop and memory accessor functions, call the required gdCreate* function and finally free the malloced buffer.
cffi:foreign-alloc seems to have an argument :initial-contents, according to what lispbuilder-sdl does. So there should be no need to perform this loop by hand. The main problem I have now is that I get strange error messages about "unknown alien functions" when trying to use def-function (which I found in gd-uffi.lisp). The function is definitely there, but seems like uffi cannot find it or something (I am not familiar with uffi).