justinstenning / Direct3DHook

DirectX Capture and Overlays by using Direct3D API hooks
http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks
MIT License
580 stars 178 forks source link

Draw Overlay not working with DirectX9 - CoD4 MW, Need for Speed Most Wanted #35

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello Justin,

After re-cloning your latest source and compiling it I cannot make it to work with my DirectX9 Games. Injection is all well now. But when I try to capture an image it crashes the game and gives error. I got two types of error for testing it in two different games. The picture of the errors were attached.

1st Game : Call Of Duty 4 Modern Warfare direct3d-problem

2nd Game : Need For Speed Most Wanted direct3d-problem2

Please try to solve these bugs as soon possible. For these the whole project seems broken.

Thanks in advance.....

justinstenning commented 8 years ago

Is this using the project without any changes whatsoever, or do you have some of your own changes in place?

The 2nd error looks to be a problem while loading an image into a sprite - does it work when you do not have a sprite being used?

The project is working with the DirectX 9 SDK samples. Does it work for any of your games? If so this would indicate that the issue is game specific.

justinstenning commented 8 years ago

Also for the 2nd one, try without ticking "Draw Overlay" and see if you get a difference.

ghost commented 8 years ago

The software I build is totally from the pure code cloned from this github repo. And I tested all the games using it. After your reply I go again and tested all my four DirectX9 games.

First of all Call Of Duty 4 Modern Warfare = All types of screenshots works fine if injected without overlay. If draw overlay is ticked then the error : WINT_DIRECTX_INIT_BODY occurs. And in-game no text overlay comes when taking screenshots. A text overlay saying : Screenshot Captured... should always come when taking screenshot as far as we know. Maybe that is not coming because of the Draw overlay not ticked?

Second Game is Need For Speed Most Wanted = Works fine without the draw overlay. If I use draw overlay it crashes with the same error stated above. Here also every screenshot methods works fine without the texture data not resulting in correct image data for png and pixeldata format problem. Will post details on that issue. Also no Screenshot Captured... text overlay shows up.

Third Game is Counter Strike Source (hl2) = Screenshots all works fine using draw overlay remain ticked and also unticked. No error occurs. But in both Draw Overlay tick and untick cases the Screenshot Captured... text overlay didn't show up when taking screenshot or Load Test. Also the pnd and pixeldata issue occurs here. Will comment some details about it on that issue.

Fourth Game FIFA 11 = Screenshots all works fine without drawing overlay. If draw overlay remains ticked then the game crashes when taking screenshot. Without draw overlay every screenshot method is fine. Here is also the png and pixeldata problem occurs. But during png or pixeldata shots no output image actually shows up. The image of the picturebox is totally blank as if no screenshot has been taken. Only with those two formats. Other formats works fine. Here also no screenshot Captured... text overlay shows up.

As far as I thought the Draw Overlay is the sprite being drawn thats why tested these games without the overlay and with the overlay.

I tested it with Watch Dogs which is DirectX11 Game using Draw Overlay and without Draw Overlay and everything works fine there without the PNG and pixeldata where pixeldata gives no screenshot at all. (Blank)

Please try to solve this problem as soon as possible.

Thanks in advance....

justinstenning commented 8 years ago

Just so you know, it will be a week or more before I can look at this.

ghost commented 8 years ago

Ok no problem...take your time...Actually I have taken delay permission grant for my project from our team. Actually it is worth time you divide the project into two different parts. One for the overlys and other is for the capture part as you told me before. And also implement the SharedMemory system into this project for the fast transaction other than the IPC. And as you have said there are lot of things need to be improved. Just focus on those with separate projects as this will also help you to handle things easily. And also try to add full overlay support and full capture support for all the DirectX versions. Also try to include DirectX8 and DirectX12 if possible. Better you start it with separating the projects first and then work on the projects little as I know you got a very busy schedule this month.

Thanks in advance...

justinstenning commented 8 years ago

A fix for this is almost ready.

ghost commented 8 years ago

Thanks man :) totally dependent on you...