I am trying to do something specific using the DirectX 9 APIs in my application.
When I setup the directx device it requires a window handle (HWND) which ultimately the graphics driver ends up knowing about and using. What I am trying to do is inside the given window handle just have the graphics driver render to ONLY a specific portion of the window and leave the rest of the window untouched. For example. Let's say my window size is 1280x720 and I only want the video frame to render and present to a location inside the window of say 300x200. What is the best way using the Directx 9 API to do this leaving all the rest of the window untouched? I have the device all setup and I can already render video just fine to the entire window, but I am trying now to render to a window handle that already contains contents and specifies to me where I should render my video frame on the same window.
I notice that even if I specify to present to a subset location of the window on the first call to PresentEx() it blacks out the entire window, and then displays my frame when I make the call to PresentEx().
I am wondering if there is a way to tell the graphics driver or DirectX runtime (not sure who is doing it) NOT to black out everything else in that window? Initially this window has some HTML elements created and I am trying to not have the driver clobber the rest of the window.
I thought about somehow having the entire back buffer present to the window but somehow making a portion of the buffer where I don't want to draw to transparent, but I do not konw how to achieve this either. Thanks for any help.