Multiple Devices

Started by
13 comments, last by Werrock 16 years, 6 months ago
Hi, Is there any tutorial how to manage multiple devices, in my case two. I've tried to create one Class that does some rendering and it works fine. But when i have two of that class and only change the contructor so that the adapter changes in CreateDevice it seems that they never gets active at the same time. One monitor use the right resolution while the other one does about nothing. The only static information they share is the D3D object. And one other thing, can I share the backbuffer between them in case I'd like one to be a copy of the other but with some additional drawing?
Advertisement
Not sure about the first question, but you can't share interfaces between devices in D3D9. I think you can in D3D10 though.

Do any functions fail? Are you using the debug runtime? Does it work if you only create one device on the second adapter?
Have a look at this MSDN document:
http://msdn2.microsoft.com/en-us/library/bb206364.aspx

That's if you are using DX9, with DX10 things seems to be simpler. Unfortunately I can't get the DX10 MultiMon sample to work on my rig, tested with non-SLI Dual 8800GTXs.

Oh, and DX10 is built for much better inter-device cooperation so it supports sharing of texture data. DX9 never implemented this feature, though it was seemingly planned.
Quote:Original post by Evil Steve
Not sure about the first question, but you can't share interfaces between devices in D3D9. I think you can in D3D10 though.


Even D3D10 doesn’t allow interface sharing. You can only share the resources but this requires that you open them on the second device again. This will give you a different interface.

The same feature can be used with Direct3D9ex.
I'm using Dx9. So I prolly need to call Direct3DCreate9 twice, one for each adapter? I'll get back with the results after some more tests then.
Quote:Original post by Werrock
I'm using Dx9. So I prolly need to call Direct3DCreate9 twice, one for each adapter? I'll get back with the results after some more tests then.
Nope, you only need one IDirect3D9 interface, but two IDirect3DDevice9's.
Generally you don't need multiple devices and since noone else has asked, I'll ask: why do you think you need more than one device? If you are showing results in multiple windows on the same screen, you most definately don't need multiple devices to do that.

My free book on Direct3D: "The Direct3D Graphics Pipeline"
My blog on programming, vintage computing, music, politics, etc.: Legalize Adulthood!

I only use one interface but two IDirect3DDevice9, that was my first try at this.

Why I need this. I'm not sure it's the right thing to do. I need it to pressent two full screen pictures. One is the usuall graphics and the other shall be a copy of this first but some addtional redeing. Some texts and lines. And I want it efficient :).
Quote:Original post by Werrock
Why I need this. I'm not sure it's the right thing to do. I need it to pressent two full screen pictures. One is the usuall graphics and the other shall be a copy of this first but some addtional redeing. Some texts and lines. And I want it efficient :).


If the two displays are connected to a single graphics card, then you can do this with an adapter group device. If the two displays are connected to separate graphics cards, then you will need two devices and only one of the graphics cards can be in exclusive mode at a time. If you want to display fullscreen images on two different graphics cards simultaneously, then use both devices in windowed mode and make your window the size of the screen with no client decorations.

Adapter group devices are covered in Chapter 2. Direct3D in my book.

My free book on Direct3D: "The Direct3D Graphics Pipeline"
My blog on programming, vintage computing, music, politics, etc.: Legalize Adulthood!

Richard,

I haven't read your book, but what you posted isn't exactly the same thing that is mentioned in the D39 SDK docs (Working with Multiple Monitor Systems).

The docs state that you can have a fullscreen mode D3D device on multiple adapters at the same time if they were all created from the same IDirect3D9 interface, share the same focus window, and are created for separate display adapters.

You don't need to run in a window to do this and can take advantage of page flipping and alternate display modes that fullscreen mode gives you.

At least that's the way I interpret what the docs say. If you've verified that this isn't the way that things work, let me know and I'll make sure that the D3D SDK docs get updated.


Working with Multiple Monitor Systems

This topic is closed to new replies.

Advertisement