Jump to content
  • Advertisement
Sign in to follow this  
akaitora

Can you mix managed and unmanaged DirectX?

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

Hi. I am writing most of my game using unmanaged DirectX. However I would like to use the Managed AudioVideoPlayback to render an avi to a texture. However, in order to use this managed directx module, I need to pass in my device. My device is a LPDIRECT3dDEVICE9 type. Is there a way I can convert it to pass it into AudioVideoPlayback::RenderToTexture(::Microsoft::DirectX::Direct3D::Device)? Thanks!

Share this post


Link to post
Share on other sites
Advertisement

There should be a Device constructor that takes an IntPtr (a managed pointer type) to an existing LPDIRECT3DDEVICE9, which allows you to wrap your unmanaged device for use with managed code. As I recall there were some memory issues with AVPlayback though, so you might want to keep a close eye on the output from the debug runtimes to see if everything runs smoothly.

Share this post


Link to post
Share on other sites
Why would you want to use AudioVideoPlayback? It's an incomplete (and buggy) wrapper for DirectShow. Do yourself a favour and use DirectShow directly in your unmanaged code. There are examples in the SDK although I believe the DirectShow stuff has moved from the DXSDK to the Platform SDK.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!