Click to See Complete Forum and Search --> : How do you put direct3d in part of a window?


Joe += smart
December 7th, 2008, 08:39 AM
I am trying to write a program that uses mainly windows code, but has a small area of the window devoted to direct3d graphics. How would I tell direct3d to only use part of the window? I tried using SetViewPort(), but direct3d drew random garbage in front of the windows stuff. It worked fine in the viewport area, but it put random crap from memory in the rest of the window. Then there was flickering when windows tried unsuccessfully to draw in front of the random crap. Can someone explain a way to have direct3d only put stuff in a part of the window?

Notsosuperhero
December 8th, 2008, 02:10 PM
This kind of a crappy solution but have you tried making a static control and then setting Direct3D's target window to that instead of a whole window?

Mike Harnad
December 11th, 2008, 08:31 AM
Direct3D can render full screen or to any CWnd object. It does not have to be a static. You should be able to create the CWnd anywhere you want on the screen.