   How to use swap chain managed directX c#
  So i have 2 windows lets call them window 1 and window 2;Pretty much the code looks like this ///---------Window1-----------////private void initializedevice{presentParams=.....;device=.....;}///---------Window2-----------////private void initializedevice{presentParams=.....;device=.....;}Now i get an error for device on window2 apparently because device 1 is already being used....Now how do i get over this error?Thankss!xxxx   
when i was doing it i just created a universal module and then loaded that dll into an application and then 'pasted' 2 of them into it ( i used 3 or 4 at one point to send them different data, but i could have had them as clones or had as many as i wanted).i was using slimdx(10) and visual studio, and they make it easy.my application is rather unique and i dont know what kind of datapaths you need between them but it worked fine for me.[Edited by - ucfchuck on April 14, 2010 4:27:59 PM];  Slimdx doesnt help me as i need to know what sort of code to put in so i can render to multiple windows   ;  it doesnt have anything to do with slimdx, it was mostly just configuring everything in VS. if you write your directx stuff into its own library and then use that in your form you can just pull up multiple copies of the same dll and send each one different data or whatever and size and place them however. im not sure but i dont think you can have one 'device' across multiple 'windows', i had one 'device' per 'window'.   ;  First off, D3D9 or 10? Doesn't really matter as the principles are the same.You use a swap chain (as mentioned in your topic)... you don't create multiple devices, you create multiple swap chains. That's about all it takes. Each swap chain is associated with one window handle (HWND).   ;  how do you make one device per window? because i get an error:S   ;Quote:Original post by harminalhow do you make one device per window? because i get an error:SCan't read? All the text got you down? Try a SnickersTM.   ;Quote:how do you make one device per window? because i get an error:SYou are doing it wrong, then.Why don't you post some code (some actual code), and a detailed description of the exact error you're getting. Without that kind of detailed information nobody can really help more than has already been done.Ideally you do want to create one device and use multiple swap chains, since that will let you share resources more easily between each window.Furthermore, MDX is a dead technology. If at all possible you should consider upgrading to SlimDX or XNA (as appropriate for your project). The fundamental principles involved here are all the same, and the API is quite similar (although less so with XNA).   ;  --------///Window1 public void Initialize()   {  presentParams = new PresentParameters();  presentParams.Windowed = true;  presentParams.SwapEffect = SwapEffect.Discard;  presentParams.EnableAutoDepthStencil = true;  presentParams.AutoDepthStencilFormat = DepthFormat.D16;  device = new Device(0, DeviceType.Hardware, panel1, CreateFlags.SoftwareVertexProcessing, presentParams);  LoadContent();    }-----------///Window2 public void Initialize()   {  presentParams = new PresentParameters();  presentParams.Windowed = true;  presentParams.SwapEffect = SwapEffect.Discard;  presentParams.EnableAutoDepthStencil = true;  presentParams.AutoDepthStencilFormat = DepthFormat.D16;  device = new Device(0, DeviceType.Hardware, panel1,CreateFlags.MixedVertexProcessing,presentParams);}InvalidCallException   ;  WHERE is the InvalidCallException thrown? WHAT do the debug runtimes say? Et cetera.However, the first thing that appears like an obvious problem from this code is that you are using panel1 for the handle for both devices. Shouldn't do that. Create two panels, one for the first device and one for the second. You're also trying to use adapter 0 the first time and adapter 1 the second -- do you actually have two graphics adapters?   