I am currently attempting to create an application that duplicates the contents of one window and displays it in another window at a smaller resolution.
What I currently have is the following: (in pseudo code)
Now, the above technique works, and does what I need. But it requires a Device Memory -> System memory -> Device Memory copy.
Ideally, I would like to optimise the technique into just a DeviceMemory -> DeviceMemory technique but I can't seem to find the correct API to get this to happen.
NOTE: I do not have any control over the applications that I am duplicating. I just want to duplicate their visuals.
Hi
I'm not all to sure a device to device pass like that is possible, but i suppose you could try setting the destination devices render target to the surface you would normally pass to it, such as:
device2->setrendertarget(surface);
device1->getrendertarget(surface);
i dont want to say that would work, im not sure on how the devices keep track of their surface pointers, but i do know from a brief bit of work on shadow mapping you had to reset the render targets etc, so i should imagine that may work if the surface pointer was not initially null
the front buffer and back buffer are the exact same, they just get swaped during drawing
draw to back buffer, flip this to front buffer and present while drawing to the other buffer (now the current back buffer)
so after you present the back buffer i suppose you could do what i said by grabbing the front buffer (which it would then be)