• Advertisement
Sign in to follow this  

[DX9] getting d3d device

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

hello!
I made a win32 application which uses directx9 to render something. Is there a function to get the current IDirect3DDevice9 ? I need it because i'm trying to render other things in my game from a place where i can't access to the rest of game code, like IDirect3DDevice9* pDevice where i stored it.

Share this post


Link to post
Share on other sites
Advertisement
There is no "current" D3D device because you can create multiple devices. If you have a texture or other resource you can call GetDevice to get the device it was created with. Otherwise just stick the pointer to the device in a global variable and you can access it anywhere.

Share this post


Link to post
Share on other sites
I can't access to resources like textures or global variables of my game.
I have to draw something on it from an other process.
I thought about replacing directx class Direct3D9 with one made by me, with every methods equals except of CreateDevice, which creates the device with the normal directx function but also saves a pointer to it somewhere.

My question is, how can i replace a directx class with mine?
Would a dll injection work?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement