Overlay Electron

五迷三道 提交于 2019-12-07 07:51:28

问题


I am wondering if it is possible to overlay an application made in electron over a game. essentially similar to how steam overlays in games.

I want this because we have made a timer web app that times tasks and are debating making it an overlay if possible. to time certain events in games that reoccur

I have no idea if this can be achieved but it is something high on our list. Any example of how this can be achieved or has anyone done this before.

Thanks,

Kieran


回答1:


To draw overlay in a game, you need hook Direct3D or OpenGL api according to which the game use.

And before present call(in D3D), you can draw your own stuff on a swapchain surface.

To control a overlay window in game, you need use Windows message hook and some other stuff.

And you should carefully manage all the windows in your program that draws in game.

There is a hook project Direct3DHook, it's written in C#, but it will be easy to write in C++.

If you want to write a good overlay engine, there will be plenty details to consider.

Overwolf is a overlay app platform, I write an overlay project at work which took about two month to be something approximate.

I have written a project, https://github.com/hiitiger/gelectron.



来源:https://stackoverflow.com/questions/35608927/overlay-electron

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