Jump to content
  • Advertisement
Sign in to follow this  
mob1930

Disable rendering ?

This topic is 3651 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

How to quit/disable/don't render a scene at all ? So, basically, I don't need to see anything, the point is in lowering CPU at mem at minimum. I am creating a D3D hook, and I tried sleep() but it didn't help. So, how to disable rendering (of everything) ? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Don't call any D3D functions?

I don't understand the problem - there's no IgnoreEverythingITellYou() function in D3D or anything, if you don't want anything rendered, just don't call any rendering functions.

Share this post


Link to post
Share on other sites
I am not making a game, I am making a hook for one game. You understand what am I saying ? I only want to leave the TCP functions of the game for example, well not that, I just want the game to stop rendering scenes.

Share this post


Link to post
Share on other sites
Quote:
Original post by mob1930
I am not making a game, I am making a hook for one game. You understand what am I saying ? I only want to leave the TCP functions of the game for example, well not that, I just want the game to stop rendering scenes.
Well, if you've hooked D3D you can just ignore the call to Present(), and nothing will be rendered.

Share this post


Link to post
Share on other sites
Quote:
Original post by mob1930
But will that lower CPU and mem usage ?
Somewhat. You can lower CPU usage considerably by ignoring Draw[Indexed]Primitive and any Set*() calls too, but for the best effect you'll have to make every call a no-op. That'll mean implementing your own interfaces so that CreateVertexBuffer(), etc can succeed and return a dummy pointer that will have hardly any memory footprint.
Effectively you're implementing every D3D interface that the app uses.

And if the app ever does something like reading back from a texture, you'll have to keep a copy of the data in any case so you can pass it back to the app.

Share this post


Link to post
Share on other sites
By ignoring calls, do you mean something like returning nothing (null) ? It's not possible to ignore a call with a D3D hook (maybe I'm wrong tho), because doesn't hook works as a proxy, something like application -> hook -> d3d interface ?

Thanks in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by mob1930
By ignoring calls, do you mean something like returning nothing (null) ? It's not possible to ignore a call with a D3D hook (maybe I'm wrong tho), because doesn't hook works as a proxy, something like application -> hook -> d3d interface ?

Thanks in advance.
If you put your own d3d9.dll file in the applications working directory, then it'll probably load that. Then the app will call your DLL's Direct3DCreate9() function. Alternatively, you can start the app up and then pause it before it calls Direct3DCreate9() (Usually done by calling CreateProcess to start the process as suspended).
In either case, your own Direct3DCreate9() function gets called. At that point, you can return your own interface which is derived from IDirect3D9. The target application will then call functions in your own class.

At that point you'll want to load the real d3d9.dll file, and use GetProcAddress() to get the real Direct3DCreate9() function. You can then use that to create a real D3D interface, and you can have your class act as a proxy, simply calling the real D3D functions, or in the case of CreateDevice, you can return another proxy object.

When the application calls DrawPrimitive, your class can simply ignore it and call D3D_OK, so the application thinks it all went well. The same goes for other functions.


So yes, you can just do nothing (return D3D_OK).

Share this post


Link to post
Share on other sites
I've already tried with a wrapper, and the application loaded it, but unfortunately it didn't start (only the splash screen). I'll try the methodes you described. Thanks much for help, I really appreciate it !

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!