Advertisement Jump to content
Sign in to follow this  
Mr Kickass

Question on devices and creating vertex buffers

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

I have multiple windows and therefore multiple devices. Does it matter which IDirect3DDevice object I use to create a vertex buffer with? Can I just snatch up any valid device to create the vertex buffers (textures too), and then use the created resources with another device, or must the same device create and use a particular resource?

Share this post


Link to post
Share on other sites
Advertisement
Resources are only valid on the device used to create them.

You can get multiple windows without multiple devices, assuming each window is on the same monitor. This can be done via Present() with a different HWND. This will stretch the back buffer to fill the specified window. If you don't want stretching you can use CreateAdditionalSwapChain() to create a new backbuffer, with it's own presentation parameters, and it's own HWND.

D3D isn't really designed for multiple monitor use, but you should use 1 device per monitor, not per window. Windows spanning multiple monitors are problematic. DirectX10/WGF2 on Vista will ease the multimonitor problems. Until then, limiting to 1 monitor is simplest, and 1 device per monitor if you absolutely need multi-mon is best.

All vertex buffers, index buffers, textures, render targets, swap chains, shaders, state blocks, etc are all tied specifically to one device.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!