This topic is now archived and is closed to further replies.


Problem rendering to the desktop

Recommended Posts

Nyko    122
I writing a renderer that will render an OpenGL scene on the desktop. I can get the handle to the desktop listview, and render to it without a problem. The problem is shutting down the program an rerunning. When I close the program and then rerun it, nothing happens for a couple of seconds and then it starts rendering, but the screen starts flickering and now the rendered scene is drawn over everything as if you trying to draw to the handle returned by GetDesktopWindow(). Also, on shutdown, it won''t let me destroy the handle to the listview, and just setting the handle to ''NULL'' doesn''t help either. I think that''s what''s causing my problem. Now, if I reboot, the renderer works fine again, for the first execution. How can I ''release'', ''free'', ''reset'', ect. this handle? Does anyone have any ideas on how to fix this? Thanks, Nyko

Share this post

Link to post
Share on other sites
a person    118
another reason why when doing crazy things on windows, you should use a windows api. better control and access to the underlying stuff. this btw is not a flame, just a "use the right tool for the job" type deal. remeber opengl does not give access to everything the hardware has 2d wise. remeber, windows owns the desktop, so you cant free the handle. you may however be able to:
WARNING: this is psudeo code.

HWND desktop = GetDesktopWindow();
HDC deskDC = GetDC(desktop);

in shutdown
ReleaseDC(desktop, deskDC);

Edited by - a person on January 14, 2002 1:13:33 AM

Share this post

Link to post
Share on other sites