Jump to content
  • Advertisement
Sign in to follow this  
Bedlamuk

Capturing DirectX Frames from Games

This topic is 4813 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 all, I'm a new member and a bit of newbie so be gentle with me :) I don't know if anyone here is familar with GameCam: http://www.planetgamecam.com Well I been using it for capturing and recording the directx games I play and this utility includes a small preview window in the corner of the game screen for each frame (its really quite smooth at 25fps and no impact on the game play). The reason I am posting a thread here is becuase I am very interested on how this type of program works. How is it possible to record each frame of a directx game ?? Where would I start ?? I'm just looking for a rough idea of which directx functions would allow me to obtain each frame rendered from any directx game. I have quite alot of experience in Win32 development and I also have the Direct90 SDK's which I use to create basic Directx apps. I use C++ and Delphi for development. thanks....

Share this post


Link to post
Share on other sites
Advertisement
There is a directx command to capture the current frame... gimme a little time and I'll look it up for ya.

Ah! There's a tutorial on it right here...
http://www.gamedev.net/reference/articles/article1844.asp

By the way: I'm not sure it's such a hot idea to capture frame by frame, I haven't looked much at the code there, but regardless it would seem to me that it would be more then a slight cpu hit.

Share this post


Link to post
Share on other sites
I'd be interested to know how Fraps does it, because it doesn't use a proxt D3D9.dll.

But the easiest way is to provide your own D3D9.dll, and put it in the app's folder. When the app starts, it'll load your DLL instead of the real D3D one.
All your DLL needs to do is load the real D3D9.dll, and create a IDirect3DDevice9. Then you just call the "real" D3D functions for most of your device functionality, but you can do extra stuff in EndScene(), such as display an FPS counter, or capture the backbuffer (although that'll probably need to be done after Present()).

Edit: See This Thread

Share this post


Link to post
Share on other sites
Wow..thankx guys for the pointers.....

I have used Fraps and it just cannot compare with Gamecam for performance. Gamecam seems to have no impact on game performance when it's capturing frames at 25fps.

Gamecam seems to hook into each game I start and then it displays it's own little preview window overlayed ontop of the game window. The preview window just shows each frame as it's captured to an avi file. You have to see it in action to understand what I mean.

I will fire up one of my games and see if gamecam is using another D3D9.dll to hook into the game.

I was hoping it was much easier to use a directx function to grab each frame from sort of offscreen buffer. But I'm puzzled as to how Gamecam can show it's own window overlayed in another game.

cheers for the quick replies.

Share this post


Link to post
Share on other sites
Showing the window in another game..

As far as I know, someone correct me if I'm wrong, but the only way to do that would be to have a DLL hook-in. That way, it could be told to take a generic screen capture, show it in the always-active window, and then save it to the avi file. In this way, it wouldn't require knowledge of the program it would be used with per-say.

Share this post


Link to post
Share on other sites
thankx....

OK I have checked the game folder and Gamecam don't seem to use another D3D9.dll
for proxy hook. The only other way I can see it hooking into the games is via a Win32 CreateProcess hook so it must be intercepting calls that way.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!