• Advertisement
Sign in to follow this  

[MDX]: DirectX service

This topic is 4250 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

Is it possible to create a DirectX device without a device window handle? What I want to do is have a device that always renders to a texture, never to a Control. The code below does not work.
PresentParameters presentParameters = new PresentParameters();
presentParameters.SwapEffect = SwapEffect.Discard;
presentParameters.IsWindowed = true;
try
{
    _device = new Device(0, DeviceType.Hardware, IntPtr.Zero,
                         CreateFlags.SoftwareVertexProcessing,
                         presentParameters);
}
catch (DirectXException)
{
} 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Create it using the handle to a hidden window/form/control with a 1x1 back buffer. Then create the render-targets and depth-stencil surfaces you want and use them.

Share this post


Link to post
Share on other sites
Nope, I don't think you can do that. Direct3D does more than just write to the window's output - it also "watches" the messages the window gets so that it can keep track of whats going on.

What you might be able to do is point it at a dummy window that is never visible, or possibly at a normal window but never presented/drawn to...

hth
Jack

Share this post


Link to post
Share on other sites
Sounds like I will create a hidden, never visible window, Thanks

Share this post


Link to post
Share on other sites
Just as a side node for future reference:

Direct3D 10 will support headless devices.

Share this post


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

  • Advertisement