I am trying to create a Managed DirectX 9 Device in a DLL and then use that DLL to render scenes to an offscreen surface. I know how to do the offscreen rendering, but my question is:
Is it possible to create a directx device inside a DLL?
Feeble attempt #1 (InvalidCallException
):
Device device = new Device(0, DeviceType.Hardware, null, CreateFlags.SoftwareVertexProcessing, presentParams);
Feeble attempt #2 (InvalidCallException
):
Device device = new Device(0, DeviceType.Hardware, new IntPtr(0), CreateFlags.SoftwareVertexProcessing, presentParams);
The device constructor overloads available are:
public Device(int, DeviceType, Control, CreateFlags, PresentParameters[]);
public Device(int, DeviceType, IntPtr, CreateFlags, PresentParameters[]);
Any help could quite possibly make my day!