Performant hooking of OpenGL to draw an overlay - problems with multiple contexts

人走茶凉 提交于 2019-12-04 05:09:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!