jpaver / opengametools

A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.
MIT License
375 stars 36 forks source link

ogt_vox: added progress callback #49

Closed dougbinks closed 1 year ago

dougbinks commented 1 year ago

This PR adds a progress callback with implementation in ogt_vox_write_scene and ogt_vox_read_scene*.

The current implementation works well for my own test cases in Avoyd. The ogt_vox_read_scene implementation could be improved slightly by adding more steps to the post processing after file reading but this did not take sufficient time to be visible in my testing.

dougbinks commented 1 year ago

Thanks for merging!

I do think a context will perhaps be useful in future but the current interface does have user data so if needed this can even be added on top of the current interface. To make chaining callbacks easier an ogt_vox_progress_callback_func ogt_vox_get_progress_callback_func() would potentially be useful, but I suspect not needed for the majority of use cases.