playing AVI's in a game

Started by
30 comments, last by computer_guy 20 years, 11 months ago
How would I go about playing AVIs in my 2d game. It is written in C++ and uses directX 8.1 and DirectDraw7 for the graphics. Could someone show me where I could find a tutorial or some code or something? Thanks in advance.
I'll Be Back
Advertisement
Use DirectShow to play avi file on directdraw7 surface, render avi to offscreen surface then blt it to backbuffer, then flip screen/ bacbbuffor, exaples are in msdn, i don''t have my source code right now in work sorry
Would any one happen to know If there is like a DirectShow engine that will do all the hard coding for me. I know It probably sounds like I''m really lazzy but I really need to play an AVI in my game i''m currently writting. And I''m pretty new to programming graphics.

Thankyou for your time.
I'll Be Back
The direct draw example using direct show is pretty simple to use, everything is all wrapped up for you. It would take a matter of a half hour at most to comment out the text drawing, and overlay functionality and then copy & paste into your game. Not that difficult at all.

If you want something even simpler look at the direct show "cut scene" sample.
FYIW AP''s solution only works for Windows XP.

Look at DDrawXCL in the directshow sample players.


find / -name "your base" -exec chown -R us:us {} ;
Look for the cutscene source code in the SDK. I think it will provide all you need.
There''s some tutorial on gamedev.net about playing AVIs in DirectDraw or something similar. It''s a simple AVI loader that keeps copying frames from the avi to the backbuffer/whatever_you_use.

Maybe you can use that?

With the cutscene sample in the DXSDK when I try to run it, it comes up with an error message box.
I'll Be Back
Well in case you want a fast solution, in which you don''t want to programm much and its just an intro avi. You could just use MCI which will only take you about 4-10 lines of code.
Offcourse its not the best solution just wanted to mention it.

-CProgrammer
What is MCI?
I'll Be Back

This topic is closed to new replies.

Advertisement