问题
Like others in previous questions, I'm trying to hook an arbitrary OpenGL application to draw an overlay onto it. I've hooked SwapBuffers and created a separate context on first call to draw into. See this SO question/answer for the general idea.
There are two big problems I'm hitting. First, the calls to wglMakeCurrent to set/restore the context before/after drawing absolutely destroy performance. Is this expected? I need to look more into using _ARB_context_flush_control as mentioned by @datenwolf in a comment on this SO question's answer.
Second, the overlay only works well on one of my two machines. On my machine with an AMD graphics card, the overlay flickers in that it is only present in some of the frames. The technique being used is the same as that used in the Mumble VOIP client server project, and that project exhibits the same overlay flicker problem. Any ideas what might cause that?
来源:https://stackoverflow.com/questions/39713133/performant-hooking-of-opengl-to-draw-an-overlay-problems-with-multiple-context