开发者

Crossplatform screen grabbing with OpenGl is it possible and how to do it?

So I found this intresting file (ref to it I found in here). It is sad

Also chech out glGrab which uses OpenGL to grab t开发者_如何学Gohe screen and is very fast.

so I wonder can we grab desctop screen frames via openGl on Windows and Linux using some openGL wrapper like SDL?


OpenGL can (easily, fast, and in a straightforward way) grab the front/back buffers that it owns and that you have a valid context for.

In other words: no.

The desktop is not owned by OpenGL. Under Windows, it is managed by the driver under pre-Vista, and by the window manager under Vista/7. You'll need the BitBlt function here, which is neither portable, nor fast.
Under Linux, the desktop may at least sometimes indeed be owned by OpenGL (compositing window managers), but you don't have a context handle for that.

If you can lessen your requirements from "Desktop" to "my window's content", then it all becomes super easy. In the simplest case, it's one function call, and if you want to do it asynchronously with DMA, it's 3-4 more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜