views:

358

answers:

3

I'm working on a C# application that needs to use Direct3D in a control in a windows form, AND (at the same time) fullscreen on a secondary monitor.

Basically, I want a Windows Forms application on one screen with a user-interface to control the graphics, and I'd like to show preview-graphics in a small control, and full-blown superduper megafancy graphics fullscreen on a secondary monitor.

What's the best way to approach this?

(For example, I know XNA can render in a Windows Forms control, but is it possible to then add a fullscreen window on another monitor as well?)

A: 

You can't have true fullscreen like that (as far as I remember), but you can make a border-less window which you can then make as big as the screen itself. It will look as if its fullscreen, but you will still suffer from windowed-mode performance penalties. (they are acceptable)

raicuandi
+1  A: 

AFAIK the only way to do this is to create 2 complete Direct3DDevices. You create one as fullscreen on monitor 2 and then you create the other as a normal windowed device. This should do what you want. Be warned, though, that you won't be able to share resources between the 2 devices ~(They will need to be created on each) and that performance will be worse than having 2 full screen swap chains on one device.

Goz
+1  A: 

I know you said Windows Forms, but I will still suggest you use WPF. The advantage is that you will be able to use the same technology for both windows.

WPF is a very nice replacement for traditional windows forms. It also stimulates you to design better solutions with better separation of model and view.

On the other hand, WPF is all rendered on top of directx. It provides you with a nice 3D engine where you can easily implement all sort of things, for some examples, take a look on the following links:

http://www.codegod.de/webappcodegod/render-3ds-3d-models-with-wpf-and-xaml-AID433.aspx

http://www.wpftutorial.net/IntroductionTo3D.html

Padu Merloti