pouët.net

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?
added on the 2010-06-28 04:15:08 by xernobyl xernobyl
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.
added on the 2010-06-28 06:22:12 by panic panic
Maybe when IE has support for webGL ;)
added on the 2010-06-28 06:42:00 by xernobyl xernobyl
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
added on the 2010-06-28 06:55:37 by QUINTIX QUINTIX
BB code fail.
but as long he uses XP it is possible? plus flash 10 is good enough to do what he wants \o/
added on the 2010-06-28 07:01:10 by panic panic
i misplt it two
it's drempels
added on the 2010-06-28 07:06:02 by QUINTIX QUINTIX
Drempels is awesome.
added on the 2010-06-28 09:45:48 by ___ ___
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.
added on the 2010-06-28 10:48:23 by psonice psonice
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:

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.
added on the 2010-06-28 16:07:33 by leblane leblane
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.
added on the 2010-06-28 17:41:47 by psonice psonice
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?
added on the 2010-06-28 17:43:55 by leblane leblane
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.
added on the 2010-06-28 18:48:28 by xernobyl xernobyl
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.
hooverphonique:

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?
added on the 2010-06-28 20:40:29 by leblane leblane
Psonice:
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.
added on the 2010-06-28 20:44:22 by Claw Claw
Insectecutor: whats your suggestion otherwise? and don't say console now.
added on the 2010-06-28 20:48:06 by v3nom v3nom
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.
added on the 2010-06-28 20:53:33 by leblane leblane
rgb2yuv conversions can be handled by shader programs.
added on the 2010-06-28 21:07:19 by pmdata pmdata
pmdata: That's a good point!
added on the 2010-06-28 21:22:25 by leblane leblane
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..
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)?
added on the 2010-06-29 17:20:09 by psonice psonice
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.
added on the 2010-06-29 17:58:38 by leblane leblane
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.
added on the 2010-06-29 20:06:38 by leblane leblane
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?
added on the 2010-06-29 23:43:34 by hexen hexen

login