Sign in to follow this  
SteveHatcher

Can D3D 11 get the created d3d Device?

Recommended Posts

This might be a stupid question but...

 

In the very limited win32 programming I have seen, whenever you call a function that needs the created HWND, you can call GetActiveWindow().

 

Does direct 3d 11 have anything like this? Such that if I open a win 32 window, then initialize a d3dDevice, I can call something that gives me previously initialized device within that window?

 

Thanks

Share this post


Link to post
Share on other sites
Like Hodgman said.

You can store the device pointer in the window data, though. Store it (or your own struct that contains it) via SetWindowLongPtr.

If you're dealing with multiple windows, keep in mind that you might want to just keep a single device; attach the per-window swap chains and default render targets to the windows rather than the device. This will be especially beneficial if you plan to share any kind of resources between the two windows.

Share this post


Link to post
Share on other sites

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