You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various functions in the API take a pointer to a CMP_Feedback_Proc function in order to receive progress notifications from the encoder and to potentially cancel the encoding. This is a useful feature.
This function pointer type is defined to have two CMP_DWORD_PTR user data parameters which are passed into the function by the encoder as it makes progress. These user data parameters are important for the function to know how to respond to the callback. Without them, it is necessary to resort to global hacks that will not be thread safe (or will be slow and serial with locks), in order to access the local state of the calling function, such as to update a progress window GUI.
However, none of these functions defined in compressonator.h that take a CMP_Feedback_Proc provide any mechanism to actually pass these pointers into the functions. As a result, the CMP_Feedback_Proc is mostly useless because it can't be used without introducing bad software design (globals).
This is perplexing because I was able to add the parameters to the functions myself and pass them internally into the codec with just a few lines of code modification. Surely you could add new functions to the API with slightly different names that provide a way to pass in the user data pointers? Such as CMP_ConvertTextureWithFeedback(), for example.
The text was updated successfully, but these errors were encountered:
Various functions in the API take a pointer to a CMP_Feedback_Proc function in order to receive progress notifications from the encoder and to potentially cancel the encoding. This is a useful feature.
This function pointer type is defined to have two CMP_DWORD_PTR user data parameters which are passed into the function by the encoder as it makes progress. These user data parameters are important for the function to know how to respond to the callback. Without them, it is necessary to resort to global hacks that will not be thread safe (or will be slow and serial with locks), in order to access the local state of the calling function, such as to update a progress window GUI.
However, none of these functions defined in compressonator.h that take a CMP_Feedback_Proc provide any mechanism to actually pass these pointers into the functions. As a result, the CMP_Feedback_Proc is mostly useless because it can't be used without introducing bad software design (globals).
This is perplexing because I was able to add the parameters to the functions myself and pass them internally into the codec with just a few lines of code modification. Surely you could add new functions to the API with slightly different names that provide a way to pass in the user data pointers? Such as CMP_ConvertTextureWithFeedback(), for example.
The text was updated successfully, but these errors were encountered: