Several HWND's = several IDirect3DDevice9?

Started by
1 comment, last by Nik02 18 years, 7 months ago
I need to render in 4 diffrent hwnd's in my level editor. But i cant find a way in d3d to do this with the same device. So i guess i have to create one device per hwnd? That raises the question, do i need to load textures, vertexbuffers etc 4 times? Or can diffrent devices share such resources? Thanks in advance.
Shields up! Rrrrred alert!
Advertisement
no you have not. In DirectX you can create an additional swap chain in order to render to multiple windows. Added to this in the Present method you can specify a window handle that can (if you want) override the one that you have specified in the D3DPRESENT_PARAMETERS.
[ILTUOMONDOFUTURO]
Look at the IDirect3DDevice9::Present() method. You can assign a HWND for use in the drawing by setting the hDestWindowOverride to something other than 0.

When you use it, you'll find that the other parameters of the Present method come in handy also - you can control the source and destination rectangles independently.

EDIT: Oh yea, the additional swap chains are also good for this type of things.

Niko Suni

This topic is closed to new replies.

Advertisement