Hi!
I'm looking for some easy way to render into multiple widows by only one device. I'm using managed directX in C#, there's an overload of the Present method that takes a control and claims that it will draw onto the control, but I can't make it work. It does not fail, but neither does it draw anything. Could you please tell me what I'm doing wrong, or maybe weather there's some easier way to do that
Thanks
Libor

Multiple windows by one device
harveyDBA
Thanks.
Dave Tormey
1. Rendering into a control means you have to pass the window handle of that control in at device creation. There are a couple of samples in managed code http://www.thezbuffer.com/articles/310.aspx and http://www.thezbuffer.com/articles/306.aspx
2. Rendering into mutliple windows withour recreating the device. Search for swap chains. I'm not aware of any c# samples that show this but you should be able to find C++ code.
Srinivas Raju
I don't have a recommended source - try google http://www.google.com/search hl=en&q=swap+chain
Robert has an article http://www.mvps.org/directx/articles/rendering_to_multiple_windows.htm on that list and his stuff is usually good. Though that looks like an old article.
amitatbangalore
Jeff2005
foreach (TargetSettings t in settings.SecondaryTargets) {
currentTargetSettings = t;
AdjustCameraForCurrentTarget();
device.Clear(ClearFlags.Target, System.Drawing.Color.Red, 1.0f, 0);
device.BeginScene();
spriter.Begin(SpriteFlags.AlphaBlend);
currentTargetSettings.Renderer.Render(this);
spriter.End();
device.EndScene();
device.Present(t.Target);
}
Here is how I used the Present method to draw to a second control... but ahh I am having trouble with this. It works KINDA, but the image is way distorted based on the sizes of the primary device target and this override target (the arg to Present).
noelweichbrodt
Look in Articles section for swap chains