Can D3D 11 get the created d3d Device?

Started by
1 comment, last by SeanMiddleditch 9 years ago

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

Advertisement
No.
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.

Sean Middleditch – Game Systems Engineer – Join my team!

This topic is closed to new replies.

Advertisement