Reuse "pack"ed buffers?

For the Compleat Fan
Locked
AVC
Posts: 3
Joined: Sun Mar 28, 2021 4:28 pm

Reuse "pack"ed buffers?

Post by AVC »

Hello,
is there a way to re-utilize a buffer created with "pack"? What I mean is:
  • You create a buffer using "pack" with some values
  • You keep the address of the buffer in a symbol (maybe a default functor) so it isn't deleted automatically
  • You "repack" the existing buffer passing the symbol or the address stored in it, writing new values into the buffer, but without allocating new memory
I think this possibility would be useful f.eg. in working with C libraries that make heavy use of buffer pointers (OpenGL, SDL etc.) and could play nicely with "struct".
Thanks and best regards
Alfonso

Locked