[RFC] Avoiding some of the globals in glretrace
Трухин А.
alxtry at gmail.com
Tue Jun 7 07:14:34 UTC 2016
Hello,
A bit of testing profiling with several passes revealed that globals
indeed play a role in consistency of results. Though, the
discrepancies are minor -- looks like it affects only the very
beginning of the trace (I guess resetting visuals would be enough to
avoid this actually).
Nevertheless, I decided to try and remove some of globals (in window
helpers and interfaces). I also think this can "improve" retracing
several files (in one run) and make code generally more portable.
Link to the branch: https://github.com/trtt/apitrace/commits/rmglob
Brief summary:
1) Promote callbacks to std::function
2) Wrap GL window system helpers in class
3) Wrap glx, wgl etc. interfaces in classes (register callbacks with
std::bind to the class object)
4) Instantiate Retracer object in the local scope of main loop
5) Instantiate and delete all the above every loop iteration
What do you think?
More information about the apitrace
mailing list