Advertisement

Problem rendering to the desktop

Started by January 13, 2002 03:32 PM
1 comment, last by Nyko 23 years, 1 month ago
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
I remember reading somewhere that setting the bit format of a device context can only safely be done once per device context.
Advertisement
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

This topic is closed to new replies.

Advertisement