Capturing DirectX Frames from Games
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....
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.
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.
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
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
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement