1e93280f47
This commit adds two classes: * ProgressTracker * ProgressScope The first is for users to implement, and to instantiate when they desire to get informed about the overall progress. The second is to be added to all functions that may take a considerable amount of time, such that they can report back how far along they are. These are much more convenient to use than the existing ProgressHandler. ProgressScope is designed such that it only requires "local knowledge" about upcoming and finished work. Scopes are nested and combined to form the final global progress. The active ProgressTracker is stored in a thread_local pointer. This is a consicius decision since in assimp there is often no 'context' passed through. The ProgressTracker may be needed anywhere, and it would be tedious and a huge change to pass it through to every function. Therefore, using a thread_local variable makes it accessible everywhere, without a major interface change. Since assimmp is single-threaded, but may be run in parallel on multiple threads, a thread_local is a good trade-off, in my opinion. This change only adds few uses of ProgressScope, to generally show how it would be used. Also for our use cases these where the most pressing places to add progress reporting, so this already covers loading from FBX files pretty well. |
||
---|---|---|
.. | ||
AssetLib | ||
CApi | ||
Common | ||
Geometry | ||
Material | ||
Pbrt | ||
PostProcessing | ||
res | ||
.editorconfig | ||
CMakeLists.txt |