On Linux systems, applications are usuallay linked against system-wide shared libraries, instead of being statically linked or having a per-application copy of the libs.
Advantages are several: saving disk space; saving RAM (when more apps load the same shared library, static data is loaded only once and COW mechanisms help saving memory); when the library gets updated, it gets updated for all the programs using it; library distribution is easier for package maintainers and so on...
Sadly, to tune many of Box2D parameters, it's necessary to tweak b2Settings.h and rebuild the library - by doing this it's impossible to share the library (unless default parameters are used).
My question now is: wouldn't it be possible to let tune (some of) this parameters at run-time, instead of compile-time?
For sure there'll be some performance penalty, but my hope is that they are negligible.
Stuff like b2_maxManifoldPoints, b2_maxPolygonVertices and b2_maxTOIContacts will probably be difficult to move at run-time, such that would require dynamically alloc'ing memory thus making them useless.
But most of the other things could be easily moved into variables / function pointers...
To avoid penalties for who's using Box2D as a statically linked library, we could have both the configurations available, selecting the wanted one at compile time according to a macro...
Could this be an interesting feature? If it is, I might try to write a patch to make things run-time tunable, and run a few benchmarks to study performance loss...
Advantages are several: saving disk space; saving RAM (when more apps load the same shared library, static data is loaded only once and COW mechanisms help saving memory); when the library gets updated, it gets updated for all the programs using it; library distribution is easier for package maintainers and so on...
Sadly, to tune many of Box2D parameters, it's necessary to tweak b2Settings.h and rebuild the library - by doing this it's impossible to share the library (unless default parameters are used).
My question now is: wouldn't it be possible to let tune (some of) this parameters at run-time, instead of compile-time?
For sure there'll be some performance penalty, but my hope is that they are negligible.
Stuff like b2_maxManifoldPoints, b2_maxPolygonVertices and b2_maxTOIContacts will probably be difficult to move at run-time, such that would require dynamically alloc'ing memory thus making them useless.
But most of the other things could be easily moved into variables / function pointers...
To avoid penalties for who's using Box2D as a statically linked library, we could have both the configurations available, selecting the wanted one at compile time according to a macro...
Could this be an interesting feature? If it is, I might try to write a patch to make things run-time tunable, and run a few benchmarks to study performance loss...