Jump to content
  • Advertisement
Sign in to follow this  
stu_pb

[MDX]: DirectX service

This topic is 4520 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
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!