<div dir="ltr"><div><div>Hi,<br><br></div>Having an ABC for glws_* sounds good. I actually have an unfinished branch to do something similar. I have to see what's best.<br><br></div>But having an ABC for glretrace_* retrace_foo doesn't look right. It's a lot of complexity for no good benefit. The callback table is nothing more than a sorted map: no matter how many interations one does, it should always yield the same result. So I rather not have the complexity. Let's use some sort of once-init or singleton paradigm.<br><div><br></div><div>I don't understand the benefit of using std::function.<br></div><div><br></div><div>Jose<br></div><div><br><div><span class=""></span><div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 7, 2016 at 8:14 AM, Трухин А. <span dir="ltr"><<a href="mailto:alxtry@gmail.com" target="_blank">alxtry@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
A bit of testing profiling with several passes revealed that globals<br>
indeed play a role in consistency of results. Though, the<br>
discrepancies are minor -- looks like it affects only the very<br>
beginning of the trace (I guess resetting visuals would be enough to<br>
avoid this actually).<br>
<br>
Nevertheless, I decided to try and remove some of globals (in window<br>
helpers and interfaces). I also think this can "improve" retracing<br>
several files (in one run) and make code generally more portable.<br>
<br>
Link to the branch: <a href="https://github.com/trtt/apitrace/commits/rmglob" rel="noreferrer" target="_blank">https://github.com/trtt/apitrace/commits/rmglob</a><br>
<br>
Brief summary:<br>
1) Promote callbacks to std::function<br>
2) Wrap GL window system helpers in class<br>
3) Wrap glx, wgl etc. interfaces in classes (register callbacks with<br>
std::bind to the class object)<br>
4) Instantiate Retracer object in the local scope of main loop<br>
5) Instantiate and delete all the above every loop iteration<br>
<br>
What do you think?<br>
_______________________________________________<br>
apitrace mailing list<br>
<a href="mailto:apitrace@lists.freedesktop.org">apitrace@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/apitrace" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/apitrace</a><br>
</blockquote></div><br></div></div></div></div></div>