Archived

This topic is now archived and is closed to further replies.

angelAnguish

playing more than one video file in a game...

Recommended Posts

Hi guys, this is my first post and would be grateful for any replies. Ive been given the task of creating a 2d game in directx, using a dxu wrapper provided by my university. Ive been progressing quite well, and decided to try to add video to the game. I have included a video file for an intro and two video files for a game lose and game win ending. However, Ive had problems with this, as for some reason, once the intro is played, if I play the game and get to either of the other videos, the 2nd video plays but you can hear the intro movie in the background, and as it is longer in size, once the second movie has finished the screen freezes and you have to wait until the intro movie has finished, then it goes back to the game. Can anyone help with this? The code Im using to render the video is: DXUShowWindow(SW_SHOW); DXURenderMediaFile("intro.mpg"); long w =640,h=480; DXUSetMediaWindowPosition(0,0,640,480); DXURunMedia(); DXUWaitForMediaCompletion(); DXUIsMediaComplete(); DXUStopMedia(); I thought this would work, using StopMedia to release the video each time it is used, but I still have this problem. Also, is there a way of quitting a movie halfway through and returning to my game? At the moment all I can do is wait until the file finishes then it returns to the game screens. Any help on this would be greatly appreciated, angelAnguish

Share this post


Link to post
Share on other sites
By using a wrapper, you've limited yourself on what you can and can't do. If it isn't supported by the wrapper, they you're SOL. If you have the time, you can directly access directShow, and write your own wrapper for it. If not, you'll have to put up with the problems of that wrapper.

You should talk with your proffessor about it, or other students who are trying to use the wrapper. They'd know more then us!
~~~~~
"Go on then" - benjamin bunny.
Download and play Slime King I.


[edited by - dede on October 5, 2003 10:40:18 PM]

Share this post


Link to post
Share on other sites
Thanks for the reply,

I was wondering though, without a wrapper, if you were just using direct x and c++, what kind of code would you use in order to interrupt a video file during play? Perhaps using that code as a basis I could figure out what it needs to be in this wrapper.

angel.

PS: Also, does anyone knowwhy when you have more than one video in a game, if you play one file then another, the first file can be heard in the background? Is this a regular occurence with rendering media/video files?

Share this post


Link to post
Share on other sites
I''ve never done it before, so I have no clue.

DirectX refers to whole bunch of APIs, what you need is just "Direct Show", which just covers Media types. You''re in luck though, Flipcode did a whole series on how to use DirectShow.

Introduction
An example program, which does what you want
Didn''t read it, but it is part 3.




~~~~~
" I...went from hopeless to sucky in a relatively short time." - entivore.
Download and play Slime King I.

Share this post


Link to post
Share on other sites