Jump to content
  • Advertisement
Sign in to follow this  
Say

[c# - Directx 9] Swap chains

This topic is 4859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok i've readed some directx 8.0-c++ example about it, but the things are a little changed with directx 9 and above all using c#. I need to show the same scene in 2 differents panels in my c# windows form application (.NET 2003). I use the following code to set the device to panel1: <code> presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Copy; DisplayMode mode = new DisplayMode(); presentParams.BackBufferFormat = mode.Format; presentParams.BackBufferWidth = mode.Width; presentParams.BackBufferHeight = mode.Height; presentParams.EnableAutoDepthStencil = true; presentParams.AutoDepthStencilFormat = DepthFormat.D16; // create the device device = new Device(0, DeviceType.Hardware, this.panel1, CreateFlags.SoftwareVertexProcessing, presentParams); device.DeviceReset += new System.EventHandler(this.OnResetDevice); this.OnResetDevice(device, null); SwapChain sc = new SwapChain(device, presentParams); </code> now what i've to do to draw the same scene for panel2? Create another device? create another presentparameter? If so where i tell to draw the same scene i nthe two panels? Really tnx to all.

Share this post


Link to post
Share on other sites
Advertisement
You can use device.Present() with an optional ovveride control. Just specify the control of whichever panel you're flipping to in the Present() call.

Share this post


Link to post
Share on other sites
but i've to create 2 devices, one for every panel (two panels are sized differently)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!