DirectX / OpenGL on (windows) Wallpaper
category: code [glöplog]
where can I find info on how to do it?
VLC has a mode for putting a video on the wallpaper. I don't want to search on VLC's source code. Any simple sample? Documentation?
VLC has a mode for putting a video on the wallpaper. I don't want to search on VLC's source code. Any simple sample? Documentation?
well there is another way for this you could add a web page as wallpaper then you can do whatever you want with it JSYK.
Maybe when IE has support for webGL ;)
didn't Microsoft abandon IE integration as of Vista?
So far as I know, it is not possible to set a webpage as a background in windows 6/7
also, dremples
So far as I know, it is not possible to set a webpage as a background in windows 6/7
also, dremples
BB code fail.
but as long he uses XP it is possible? plus flash 10 is good enough to do what he wants \o/
but as long he uses XP it is possible? plus flash 10 is good enough to do what he wants \o/
i misplt it two
it's drempels
it's drempels
Drempels is awesome.
Winamp used to have a mode that worked like that too. But, seriously, why do it? It's cool to play around with for a short while.. but actually pretty pointless. Most of the time you don't see the desktop, when you do it gets distracting, and all the time it's wasting resources.
VLC seems to be using DirectDraw overlays. Which basically works a little like chromakeying (Waffley wikipedia article on the topic). You define a mask colour which gets replaced with the overlay.
The VLC code is just grabbing a handle to the desktop:
changing the background colour to its chroma key colour, and setting up an overlay.
If you wanted to use this for Direct3D/OpenGL, you'd have render offscreen and copy the data back into main memory. Not too bad on modern cards, but would be a killer on older AGP cards.
There's a basic example of doing overlaying here: http://www.gamedev.net/community/forums/topic.asp?topic_id=359319. They mention doing the Direct3D rendering and then copying it back, but I think you're on your own with that I'm afraid.
The VLC code is just grabbing a handle to the desktop:
Code:
HWND hwnd = FindWindow(_T("Progman"), NULL);
if (hwnd)
hwnd = FindWindowEx(hwnd, NULL, _T("SHELLDLL_DefView"), NULL);
if (hwnd)
hwnd = FindWindowEx(hwnd, NULL, _T("SysListView32"), NULL);
if (!hwnd) {
msg_Warn(vd, "couldn't find \"SysListView32\" window, "
"wallpaper mode not supported");
return;
}
changing the background colour to its chroma key colour, and setting up an overlay.
If you wanted to use this for Direct3D/OpenGL, you'd have render offscreen and copy the data back into main memory. Not too bad on modern cards, but would be a killer on older AGP cards.
There's a basic example of doing overlaying here: http://www.gamedev.net/community/forums/topic.asp?topic_id=359319. They mention doing the Direct3D rendering and then copying it back, but I think you're on your own with that I'm afraid.
non-ancient cards handle overlays in hw, afaik.. that should eliminate the need for copying back to main mem.. or am i misunderstanding?
Totally guessing here, but on newer (vista+) versions doesn't windows use some kind of layer compositing system for drawing windows? If so, investigate the layer stack, maybe it's possible to insert a layer between the desktop wallpaper and icon layers? It'll probably be all modern and accelerated and stuff too.
hooverphonique: it's possible I'm missing something too :) - but unless I'm mistaken, the image that's overlayed is going to have to be in a directdraw surface, and I can't think or any good way of persuading D3D to render directly to that, or to do a direct video memory copy between the D3D surface and the ddraw surface?
Vista / 7 has a more modern feature to do it, but you loose your desktop icons. You get something like a fullscreen app behind the windows task bar. It can be interesting for some customized desktop coding.
leblane: quote from MSDN: "Starting in Windows 7, Direct3D 9 supports hardware overlays."
why they chose to implement this new functionality for D3D9 i have no idea :-)
xernobyl: looks like that is the solution if you can make do with win7.
why they chose to implement this new functionality for D3D9 i have no idea :-)
xernobyl: looks like that is the solution if you can make do with win7.
hooverphonique:
and
It sounds very much like it can only overlay ONTO a Direct3D surface, not overlay a Direct3D surface?
Quote:
A hardware overlay is a dedicated area of video memory that can be overlayed on the primary surface
and
Quote:
Overlay is performed using a destination color key, but the Direct3D runtime automatically selects the color and draws the destination rectangle.
It sounds very much like it can only overlay ONTO a Direct3D surface, not overlay a Direct3D surface?
Psonice:
I agree. Fuck the desktop. It's a stupid UI paradigm that needs to die.
Quote:
actually pretty pointless. Most of the time you don't see the desktop, when you do it gets distracting, and all the time it's wasting resources.
I agree. Fuck the desktop. It's a stupid UI paradigm that needs to die.
Insectecutor: whats your suggestion otherwise? and don't say console now.
By the way, one thing to be aware of is that cards can be finnickey bastards about what overlay pixel formats they support. For instance my GeForce 9800 doesn't seem to support any RGB formats for overlay, only formats like YUV2, etc. Having to convert the Direct3D rendered surface to YUV as well would be a pain.
rgb2yuv conversions can be handled by shader programs.
pmdata: That's a good point!
leblane: You may be right, I don't know..
hw overlays were normally (only) used for showing video sequences, so I guess yuv would be the natural choice..
hw overlays were normally (only) used for showing video sequences, so I guess yuv would be the natural choice..
why the hell were overlays and chroma keying used for video overlays anyway? To avoid copying textures off the video card if you have HW accelerated video in a software rendered ui maybe?
Are overlays still used in vista/7 (other than for compatibility)?
Are overlays still used in vista/7 (other than for compatibility)?
Yeah, I think it was pretty much so you can display YUV formats without doing the conversion in software. Also, it could scale the video in hardware and then render it into the UI without having to copy it back afterwards.
It seems at least on my Win7 system that overlays don't work unless you disable Aero, which makes sense.
It seems at least on my Win7 system that overlays don't work unless you disable Aero, which makes sense.
Just a thought, Windows Dreamscene didn't use overlays, played nicely with Aero, AND preserved the icons. No idea how it did it, and it could well use secret Microsoft APIs, but still.
setparent api to set the desktop as the parent of your opengl window and then set that window on bottom with setwindowpos. so your icons are visible?