Log in

View Full Version : Render to desktop... help!



XeviaN
29-07-2003, 10:19 AM
Hi all!
I've tried a little time ago to render directly to desktop (handle 0).
But windows (and DX) ****s me off every time i have tried :roll:

Is there a "volounteer" to try this thing? :? HELP! How can i initialize DX on desktop surface without crashes? :oops:

It's a cool thing to do. I've seen a realtime 3d desktop and it's very cool... :evil:

See you!

XeviaN
29-07-2003, 06:57 PM
So, getdc(0) is not a solution. Someone tells to make an activex and activate active desktop to load a page with it (bleah) :x
I've found this:

---cut---
I would recommend, based on what I know of raw win32, using
WS_EX_TRANSPARENT when creating your window or something like that. Then
blitting or drawing on your own space, appearing to have been drawn on
desktop itself. Something like "colorkeying" your WND. A better way would be
copying part of desktop area to your buffers (using CreateDC(0)), then
drawing it together with your stuff. Maybe making the window child of
desktop... this is actually offtopic discussion.
---cut---
So after some tests,
using the WS_EX_TRANSPARENT style, and create the window
as a child of the desktop window, blitting with colorkey
works fine !
---cut---

Hmm... :?

cairnswm
30-07-2003, 06:14 AM
GetDC(0) will work if using the standard GDI functions.

Is there anyway to point a DirectX surface at an already existing Canvas?

XeviaN
30-07-2003, 12:07 PM
Yes, i tried also getdesktopwindows to get handle to desktop, but no result at all (nothing was rendered) :roll:

I have seen a 3d desktop software and analized it.

OH, it's an ACTIVE-X loaded on the desktop with Active Desktop! ARGH!
But works... :shock:

I'm now experimenting... :wink:

XeviaN
30-07-2003, 11:08 PM
OOOOH! DONE! :D

I've a perfect 3D Animated Desktop rendered realtime 8) with a stupid Active-X :?

Oh, just a little fix... it uses about 100% of my cpu... :roll:

x Clootie: i've used the RUN loop in D3DAPP, but it seems not to leave enough idle time to other processes. How can i do? The other software i tried (Desktop Dreamscapes 3D) uses cpu only when no other processes request for it. By now, this is [OT] in this thread.

Thanks for help.

Clootie
30-07-2003, 11:54 PM
You can do something like this:
[background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000]
while Running do
...
// Update and render a frame
if fMyApp.m_bActive then
begin
fMyApp.CheckForLostFullscreen;
fMyApp.Render3DEnvironment;
if (strStatsPrev <> fMyApp.m_strFrameStats) then
StatusBar.Panels[0].Text:= fMyApp.m_strFrameStats;
end;
...
Sleep(fMilliseconds); // fMilliseconds - can/should be dynamically changed so frame rate is fixed.
end;

Basically call "// Update and render a frame" block fixed count per second. And how often to call is your decision. Good realization example is something like TDXTimer from DelphiX.