nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.31k stars 7.69k forks source link

Update stb_rect_pack.h Change the type of stbrp_rect.id from int to void* for more flexible api #1462

Closed Anaskorichi999 closed 1 year ago

Anaskorichi999 commented 1 year ago

Update stb_rect_pack.h Change the type of stbrp_rect.id from int to void* for more flexible api

nothings commented 1 year ago

this would break anyone using the current id. you can make this change locally but it doesn't make sense to accept.

Anaskorichi999 commented 1 year ago

What do you think of adding this struct stbrp_rect { stbrp_coord x,y; int id,w,h,was_packed; void *userdata; };

nothings commented 1 year ago

It just doesn't seem very necessary? You can make a parallel array of void, or make an array of void indexed by id if you need that functionality.