Sign in to follow this  
d000hg

Multiple monitor Direct3D (again)

Recommended Posts

I decided supporting multiple displays is the next thing to implement for my game. I already have a D3D wrapper which finds all the display adapters and lets you choose which one to use. However it works by vcreating a single window at construction, then later creating a Direct3DDevice8 for this window. Since windows are normally displayed on the primary monitor it went wierd creating an adapter on the 2nd monitor - in fullscreen mode it would render a white window on monitor1, while rendering the scene on monitor2, but the windows underneath would flicker through. I established the window needs to be underneath the area where D3D is drawing. But now I want to have 2 Direct3DDevice8 objects at the same time for 2 adapters/monitors. So do I need two windows? I could potentially create a window taking up the whole virtual desktop - would that work? One problem is that if I want to use 2 monitors on a 3-monitor system I can't. But with two seperate windows I'd get messages to them both which is a bit fiddly...

Share this post


Link to post
Share on other sites
That's why there are focus windows and device windows...

1) give all devices the same *focus* window. This is your main application window - it recieves window messages for your whole application; this is what D3D hooks into when it wants to know whether your app is in the foreground or not.

2) each device has a unique *device* window (see the D3DPRESENT_PARAMETERS).

3) the device window for the first device can be the same as the focus window for the whole app. Every other device window has to be a different window.

4) Messages you get for any device window which isn't the application focus window only relate to that particular area of the screen underneath your fullscreen display rather than to your app - so you don't need much if any window message processing for those.

Share this post


Link to post
Share on other sites
I just came across those terms for the first time yesterday, but only in the context of DirectDraw. So my focus window is best set up to be fullscreen on the primary display adapter's monitor, and each additional device window should be made fullscreen on that device's monitor?
For multimonitor windowed applications (I find it easier to debug runnning in a window) I can still have the same windows, but just not set D3D fullscreen - that should work OK? Out of interest, can I have one device fullscreen and another running in windoweed mode or will that break?!

Thanks Simon.

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