Sign in to follow this  

Multiple LPDIRECT3D9 objects

This topic is 3866 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'm in the process of writing library functions that interface with Direct3D. However, it is possible that the user of these libraries has already instanced a Direct3D9 interface, and even created devices and set render states in it. Given that, I was wondering whether somebody could help me with some questions: 1) If my user has already created a Direct3D9 interface and is already controlling the screen with a LPDIRECT3DDEVICE9 object, is there any way I can find that out? 2) If that's the case, can I query Windows for this information? How? 3) If it's not possible to get this information, what are the implications of having multiple LPDIRECT3D9 and LPDIRECT3DDEVICE9 objects controlling the same device? Thanks.

Share this post


Link to post
Share on other sites
To the best of my knowledge, there's no way to get the current device, or to determine if one has been created.
I don't really know what will happen if you try to create two devices on one window, I suspect the second one will just fail at the CreateDevice() call.

Surely if a user is using your library, it's their own fault if they've already got a device?

Share this post


Link to post
Share on other sites
Actually, this is quite possible. They may already have some graphics going on, but may want to use my library for some very specific action they don't want to deal with.

A good example would be they are writing a game but all they want from my library would be the ability to create a person with all its attributes to add to the game. In that case, I need to *fit in* their environment, rather than force one upon them.

At the same time, them may prefer to let me deal with ALL graphics issues. In this case, I would control all Direct3D objects from the start.

Thanks.

Share this post


Link to post
Share on other sites
Namethatnobodyelsetook: thanks! I was wondering whether I would have to have them pass me the pointers, or whether I could just query Windows for it.

Looks like they have to pass it over to me :-(

Thanks again.

Share this post


Link to post
Share on other sites

This topic is 3866 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this