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

Meshify User Callback #6

Closed mrpossoms closed 3 years ago

mrpossoms commented 3 years ago

Added callback to context and ogt_mesh_from_paletted_voxels_simple to allow caller code to intercept / modify vertex information when a voxel has been tesselated.

This is useful for ogt users who may have state data in addition to the voxel volume which may influence the appearance of the voxels, or even their own vertex definitions.

mrpossoms commented 3 years ago

Hey @jpaver! Thanks for reviewing those changes earlier! I had some revisions I wanted to make, which made the approach a bit more general, and added the feature of being able offloading allocation to the caller. Let me know what you think of it in its current state, I'll gladly make any changes you suggest!

jpaver commented 3 years ago

Hey @mrpossoms, FYI I took inspiration from this PR and formulated a new PR with some addition thoughts: https://github.com/jpaver/opengametools/pull/7, you can see the reasoning behind those choices in a comment in that PR. Please let me know if that works for you, or if you have additional constraints that that PR doesn't solve, and we can make changes to that and get it in. Cheers!

jpaver commented 3 years ago

Closing as PR https://github.com/jpaver/opengametools/pull/7 has been merged instead -- thanks for the feedback @mrpossoms!