nicebyte / nicegraf

An abstraction layer for graphics APIs.
198 stars 13 forks source link

Custom allocators don't support user-provided state #205

Closed rkevingibson closed 5 months ago

rkevingibson commented 5 months ago

I appreciate the ability to provide ngf_allocation_callbacks, but one problem is that the callbacks don't take a void* userdata parameter, requiring any custom allocators to rely on global state. I'm happy to do the changes and submit a PR but wanted to see if there's interest first. It seems like a fairly small change, since all allocations seem to go through macros NGFI_ALLOC/NGFI_FREE, so the change would be:

nicebyte commented 5 months ago

Sure, that would be a nice improvement. Feel free to submit a PR. Thank you!