Jump to content
  • Advertisement
Sign in to follow this  
Jacob Roman

DirectX8 - Playing a Video in a Polygon

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

Advertisement
How's about a tutorial to play video in directx8? I can't find anything in the subject. Thanks.

Share this post


Link to post
Share on other sites
There are many sites that show you how to play videos using DirectShow, like DirectX4VB for example. But what I'm looking for is something on playing videos inside a polygon. A tutorial on that would be nice to have. Google can't find squat on the internet regarding this subject. And I'm still digging the the source code of the Texture3D prog in the SDK, trying to find out what functions they used to do this. I hate playing this "Wheres Waldo" kinda game with myself, so any help would be appreciated. :)

Share this post


Link to post
Share on other sites
It's dynamic texture maps i believe... Just copy the video bits to the textures surface and render it. I could be wrong though.

Share this post


Link to post
Share on other sites
Never really worked with that before. Normally I just do what I always do when texturing polygons. Load my BMP file using CreateTextureFromFile, set some attributes, draw the polygons or polygonal objects, and vwola.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daggett
It's dynamic texture maps i believe... Just copy the video bits to the textures surface and render it. I could be wrong though.


I believe you are right. I haven't dealt with video before actually but I'm pretty sure there is a method of gaining access to the raw frame data at a specific time interval. You'll have to create a blank texture using IDirect3DDevice9::CreateTexture with the correct size of the video. Once that is done I suspect that you gain access to the video frame pixels and lock you texture, fill it, then unlock it and use it like any other texture.

Share this post


Link to post
Share on other sites
I haven't done anything at all with DirectShow before, but here's a link with all of the interfaces for it (since I don't know what you're using): MSDN
Look for the something along the lines of locking and unlocking, as PumpkinPieman suggests.
If it is for Direct3D, you would create a texture of the same dimensions of the video (beware of padding), and get the texture's surface level using IDirect3DTexture8::GetSurfaceLevel(). From there you would proced to lock the surface, get the surface's data, fill it in with the data from DirectShow, unlock the surface, release the surface, and then apply the texture to a primitive. However, this would be somewhat slow...

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!