Jump to content
  • Advertisement
Sign in to follow this  

Porting DirectShow.NET from MDX to SlimDX

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

The source code to the ported sample : http://ajden.towfeek.se/VMR9Allocator.zip When I play a file I can only here the sound, the image isn't rendered correctly. Can someone see an error in my code? And yes, before anyone replies I have moved the Clear-invoke to after I invoke BeginScene on the device, I can only see black. Rendering is as follows : device.SetRenderTarget(0, renderTarget); device.BeginScene(); device.Clear(ClearFlags.Target, m_black, 1.0f, 0); Surface surface = Surface.FromPointer(lpPresInfo.lpSurf); Texture texture = surface.GetContainer<Texture>(); scene.Draw(texture, m_black); device.EndScene(); device.Present(); I have concluded that it's the following line that goes wrong. scene.Draw(texture, m_black); Why? Maybe someone here can tell me? Please email me, feel free to include modified project as attachment. ajden.towfeek [at sign] gmail.com [Edited by - ajdto234 on December 20, 2008 5:12:25 PM]

Share this post

Link to post
Share on other sites
I've made some progress, the updated version is on the same url.

I can actually poll the first frame and display it now before it goes black, perhaps now someone can see the error?

Rendering :

device.SetRenderTarget(0, renderTarget);
using (Surface surface = Surface.FromPointer(lpPresInfo.lpSurf))
Texture texture = surface.GetContainer<Texture>();
scene.Draw(texture, Color.White);

Proof : http://ajden.towfeek.se/first_frame.jpg :-)

Share this post

Link to post
Share on other sites
I've did some test on your code. It's seems that the problem lies in your rendering code.

I change the texture to load an image (not a good idea to do in the render loop, but just for the sack of debugging) using
Texture texture = Texture.FromFile(device, filePath);

Well, nothing is rendered. I still couldn't figure out the problem on the Sprite as I never used it before. I used 3D object all the time.

Maybe you can try to get it working by displaying some simple picture, then only load the texture from video.

If you intend to progress into 3D, do take a look at VMR9Allocator2. It's easier to fix than VMR9Allocator (for my case) :p

[Edited by - faulty on December 24, 2008 2:00:08 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!