在没有窗口的Windows桌面上绘制OpenGL [英] Draw OpenGL on the windows desktop without a window

查看:387
本文介绍了在没有窗口的Windows桌面上绘制OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这样的事情,我想知道如果这是可能的,说我运行我的应用程序
,它将显示任何下面的渲染。



基本上,在屏幕上没有窗口。



注意:想在Windows和c ++中执行此操作。

解决方案

可以使用您的应用程序在其他应用程序的窗口上绘制。一旦你找到了你想要的窗口,你有它的HWND,然后可以使用它就像它是你自己的窗口的目的绘图。但是由于那个窗口不知道你已经做到了,它可能会弄乱你在它重绘它自己绘制的任何东西。



有一些非常复杂的方法来解决这一问题,其中一些涉及使用窗口钩子截取到该窗口的绘图消息,所以你知道它何时重绘,以便你也可以做你的重绘。



另一个选择是在窗口上使用剪切区域。这可以让你给你的窗口一个不寻常的形状,并有一切背后它仍然看起来正确。



还有方法来接管桌面背景窗口的绘制,你可以运行一个应用程序,在桌面背景上绘制动画和东西(而桌面仍然可用)。至少,这是可能通过XP,不知道是否已在Vista / Win7中更改。



不幸的是,所有这些选项都太复杂,深入无需有关您尝试执行的操作的更多信息。


I've seen things like this and I was wondering if this was possible, say I run my application and it will show the render on whatever is below it.

So basically, rendering on the screen without a window.

Possible or a lie?

Note: Want to do this on windows and in c++.

解决方案

It is possible to use your application to draw on other application's windows. Once you have found the window you want, you have it's HWND, you can then use it just like it was your own window for the purposes of drawing. But since that window doesn't know you have done this, it will probably mess up whatever you have drawn on it when it tries to redraw itself.

There are some very complicated ways of getting around this, some of them involve using windows "hooks" to intercept drawing messages to that window so you know when it has redrawn so that you can do your redrawing as well.

Another option is to use clipping regions on a window. This can allow you to give your window an unusual shape, and have everything behind it still look correct.

There are also ways to take over drawing of the desktop background window, and you can actually run an application that draws animations and stuff on the desktop background (while the desktop is still usable). At least, this was possible up through XP, not sure if it has changed in Vista/Win7.

Unfortunately, all of these options are too very complex to go in depth without more information on what you are trying to do.

这篇关于在没有窗口的Windows桌面上绘制OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆