Multiple DirectX forms

  • Thread starter Thread starter Jon Harrop
  • Start date Start date
J

Jon Harrop

Hi!

I am trying to write a program to visualise data using DirectX. I have
written a class derived from Form that creates a window, initialises
managed DirectX and draws the appropriate animation.

I want the user to be able to spawn as many new forms as they want. They are
essentially independent and I have written them as such: each one creates
its own DirectX device with "new Device(...)". I am creating a new form by
creating a thread and calling "Application.Run(form)" in it to create a new
message loop for that form.

Although my program works perfectly when only one form is open, attempting
to open multiple forms seems to result in them corrupting each other. I'm
not sure if I am misusing WinForms here or if this is a managed DirectX
issue?

Does anyone know how to use multiple forms and managed DirectX devices
from .NET?
 
Hi

What you're trying to do should actually work..
However the performance loss by creating multiple devices using the same
adapter is extreme. I recommend to do everything with the same device.
Btw, if you want to visualise scientific data, OpenGL would most likely be
the better choice or you could use already existing tools, e.g www.avs.com .
 
Back
Top