graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Tue, 08 Jun 2004 00:55:39 GMT


The DDraw documentation says:

----
As long as you create the DirectDraw object for the null devicehat is,
pass NULL to DirectDrawCreate as the lpGUID parameterirectDraw will
blit to the entire window regardless of where it is located. However, if
the device is created by its actual GUID, this is not the case, and blit
operations that cross an edge of the primary surface will be clipped (if
you are using a clipper) or will fail, returning DDERR_INVALIDRECT.
----

So I've created the DirectDraw object for the null device, and when the
dual monitors are spanning the desktop everything is fine. However, when
I'm in dual view mode (each monitor is a separate display), Blt() fails
with E_NOTIMPL when I move my window over to the non-primary display.

Am I missing something? It looks like the documentation is saying that I
don't have to do anything special to support dual monitors, but it's
failing on this card at least. (Dual head GeForce FX5200 with latest
Detonator drivers.)

If I do enumerate the displays and create one DDraw object for each
display, what about the surface I need to blit? If I created it using
the primary display DDraw object, I assume it's owned by that, and that
I can't just blit it directly to the secondary display?

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by Philip Taylor[ATI] » Tue, 08 Jun 2004 03:02:40 GMT


how does the DDraw Multinut sample operate?

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Tue, 08 Jun 2004 03:14:17 GMT

On Mon, 7 Jun 2004 12:02:40 -0700, "Philip Taylor[ATI]"



I assume this is a DX7 sample? I haven't been able to find the DX7 SDK
online anywhere. All the download links are broken. Do you know where I
can find it?

I do have the DX7 documentation, but none of the samples.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by Philip Taylor[ATI] » Tue, 08 Jun 2004 05:26:52 GMT

its available from the ms.com download page, if you search for it.

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Tue, 08 Jun 2004 05:43:40 GMT

On Mon, 7 Jun 2004 14:26:52 -0700, "Philip Taylor[ATI]"



I've looked all over, but the only link I can find to it on
microsoft.com is broken:

http://www.microsoft.com/downloads/details.aspx?FamilyID=3fae2dbe-1d47-4f03-97d3-3274bff70e8d&displaylang=en

In the DirectX download section, it only goes as far back as 8.0, which
I downloaded. It does have DirectDraw samples, but no sample called
Multinut. It does have a Multimon sample, but that is a fullscreen
sample, and I'm in windowed mode.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by v-yiy » Tue, 08 Jun 2004 13:44:40 GMT

Hi Thore,

Do you have a sample names WindowMode in your Dx8 SDK?
You may try this sample and see if it works on your system, maybe this is
a Driver http://9573f00jrksyaq7x-fvlpkrrco.hop.clickbank.net/?tid=DATABASEFORUM " target="_top" rel="nofollow">[Driver Robot fixes your driver problems] issue, in my quick test, the sample worked fine on my ATI 9500
card.

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Wed, 09 Jun 2004 00:15:42 GMT

On Tue, 08 Jun 2004 05:44:40 GMT, XXXX@XXXXX.COM ("Ying-Shen



Yep, it works fine here too. Which is surprising, because I can't see
that I'm doing anything substantially different. One thing I am doing
differently is that I'm not creating a backbuffer and BltFast()-ing to
it, I'm Blt()-ing directly to the primary surface.

I looked through ddutil.cpp, which WindowMode uses, and I am creating
the DDraw object and the primary surface exactly the way it does it. I'm
also setting the clipper the same way ddutil.cpp does it.

I create an offscreen surface in video memory that is the same color
depth as the screen, lock it, fill it up with data, unlock it, and Blt()
it to the primary surface. I even tried BltFast(), but I got E_NOTIMPL
there too. My Blt() call looks just like the one used to present the
backbuffer in ddutil.cpp.

WindowMode doesn't do anything at all to handle multiple monitors, so
I'm wondering why my stuff isn't working. I tried cranking up the debug
output, but I didn't get anything when the blit failed.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by v-yiy » Thu, 10 Jun 2004 11:59:37 GMT

Hi Thore,

I'm investigating this issue, since the window mode also works fine on your
system, could you seperate this issue into a simple sample and send it me ?
I'll try to investigate it to see if I could figure out something.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Sat, 12 Jun 2004 06:22:03 GMT

On Thu, 10 Jun 2004 03:59:37 GMT, XXXX@XXXXX.COM ("Ying-Shen



I emailed you a small sample, I still don't see exactly what I'm doing
wrong. If I don't specify a pixel format, the sample seems to work, but
I need to control the pixel format somewhat since I'm passing the buffer
to others to fill it up. It fails whether I use YUV surfaces or RGB
surfaces with the same bit depth as the desktop.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Sat, 12 Jun 2004 06:26:31 GMT

On Fri, 11 Jun 2004 17:22:03 -0500, Thore Karlsen [MVP DX]




Btw, that's also why I can't just open one device for each monitor and
blit directly. I only have one copy of the surface. I'd really prefer
not to have a buffer in system memory as well, since the amount of data
is very large, and the CPU load is already very high.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by v-yiy » Tue, 15 Jun 2004 21:20:20 GMT

Hi Thore,

I tested the code on the test machine, it returned E_NOIMPL too, when I
moving the window to another screen.
In further investigation, it seems the pixel format of the backsurface
affects,
If I change the pixel format to RGB32 the blit worked, so I suspect if this
issue was probably caused by the Driver http://9573f00jrksyaq7x-fvlpkrrco.hop.clickbank.net/?tid=DATABASEFORUM " target="_top" rel="nofollow">[Driver Robot fixes your driver problems] of the display card or DX runtime
does not implement color transformation from YUY2 to RGB under multi
monitor.

I'v sent a mail to the Product group to see if they could come up with some
ideas on this issue. I'll update this thread to let you know as soon as I
got a reply.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

graphics >> DirectDraw and multiple monitors

by yhhuang » Wed, 16 Jun 2004 16:39:05 GMT

Hello Thore,

Currently I am finding somebody in ddraw support team to look into it and we will reply here with more information. If you have any more
concerns, please feel free to post here and we will follow up.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

graphics >> DirectDraw and multiple monitors

by GregB » Thu, 17 Jun 2004 00:42:16 GMT

Hi,

Your sample was forwarded to me. I work in Microsoft Developer support.
You are creating a YUY2 surface on one video card and trying to display it
on another. It is recommended that windowed DirectDraw applications be
specifically designed for MultiMon by maintaining separate DirectDraw
objects and surfaces for each monitor. Do not use the null device. If you
send me an email, I will reply with a multimon sample which does this. My
email address is XXXX@XXXXX.COM .


your
me ?

Thanks,
-Greg
Microsoft Developer Support



This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.

graphics >> DirectDraw and multiple monitors

by Thore Karlsen [MVP DX] » Thu, 17 Jun 2004 03:48:52 GMT

On Wed, 16 Jun 2004 16:42:16 GMT, XXXX@XXXXX.COM (Greg



It's on the same graphics card (dual head NVidia), so I would assume
that they shared video memory. Keep in mind that the code works if I set
the multiple monitors up as one wide display instead of using dualview.

The problem also occurs even if I create an RGB surface (with alpha
pixels) in the sample I made. In my application it happens even if I
don't specify the pixel format at all, but I'm not sure why that happens
in my application and not in the sample. As far as I can tell, the basic
code is the same, so it doesn't seem very predictable.


Recommended or necessary? The documentation doesn't seem to indicate
when one should expect the null device to fail. In fact, it says that by
using the null device, DirectDraw will handle things behind the scenes.

The problem with keeping separate surfaces for each device is that I'm
potentially displaying dozens of channels of video simultaneously, so
there's an enormous amount of data floating around. I'd have to keep
system memory buffers and copy those to the correct surfaces as needed,
and the overhead would be very high. As you can expect, the load on the
system is already very high.

Is there really no way around this? If there's a way I can at least use
surfaces in the current display format without failing, I could work
with that. But as mentioned, that also fails in my application when I
don't even specify the pixel format.

--
Be seeing you.

graphics >> DirectDraw and multiple monitors

by GregB » Sat, 19 Jun 2004 00:38:26 GMT

i,

If you do not specify a pixel format, then the Blt should work just fine.
Try creating a normal RGB surface with no alpha. The Blt should work. If
not, then create it in system memory. There is no way to get the Blt to
work the way you want with a YUV surface (or RGB with alpha). You need to
create individual devices (not use the NULL device).

As long as the DirectDraw object is created on the null device and is not
rendering directly to the primary surface, a non-full-screen DirectDraw
application will work automatically with MultiMon and the user will be able
to drag the window from one monitor to another. However, DirectDraw will
take advantage of hardware acceleration only when the window is entirely
within the primary display. When you go from one monitor to another, then
there is no help from the video card. We do not convert from YUV to RGB in
software, so the Blt fails.

Solution: It is recommended that windowed DirectDraw applications be
specifically designed for MultiMon by maintaining separate DirectDraw
objects and surfaces for each monitor. Do not use the null device. If you
require YUV to RGB conversion Blt's, then it is required that you
maintaining separate DirectDraw objects and surfaces for each monitor.

Sorry for the bad news. The way DirectDraw is set up, those two video outs
are considered separate devices unless you use dualview.


it

Thanks,
-Greg
Microsoft Developer Support



This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.



Similar Threads

1. DirectDraw with multiple monitors

Hi,
I am having a terrible time getting DirectDraw7 to work correctly with
multiple monitors. I want both displays set to exclusive mode. Through lots
of experimenting I can get to the point where I can do this, but as as soon
as I call SetDisplayMode() on the second display, the surface on the first
display appears to be lost.

Here is basically what I am doing:

IDirectDraw7* lpDD1,* lpDD2; // Initialised for both monitors

lpDD1->SetCooperativeLevel(hwnd,DDSCL_SETFOCUSWINDOW);
lpDD1->SetCooperativeLevel(hwnd,DDSCL_SETDEVICEWINDOW|DDSCL_EXCLUSIVE|DDSCL_
FULLSCREEN);
lpDD1->SetDisplayMode(1024,768,32,0,0);

lpDD2->SetCooperativeLevel(hwnd,DDSCL_SETFOCUSWINDOW);
lpDD2->SetCooperativeLevel(hwnd2,DDSCL_SETDEVICEWINDOW|DDSCL_EXCLUSIVE|DDSCL
_FULLSCREEN);

// all is ok up to this point, and then..
lpDD2->SetDisplayMode(1024,768,32,0,0);

Although the second call to SetDisplayMode() works, the surface is lost on
the primary display.

Instead of using a second window (hwnd2) in the call to
lpDD2->SetCooperativeLevel() I have also tried passing the same window
handle as in the other calls and specifying DDSCL_CREATEDEVICEWINDOW, but
this fails with E_INVALIDARG.

Does anyone have any ideas?

Thanks,
Jon



2. Multiple Monitors Using DirectDraw

3. View multiple monitors from a single monitor

Hello all. I need some help finding a remote software that will allow
me to view multiple monitors (2-3) from my single monitor. Is there
such an application out there? I currently have RADMIN and can remote
and view one monitor on computers but we have users in our office
using 2 or 3 monitors. I am only able to view the far left monitor
when remoting in.

Any advice would be greatly appreciated.

4. DirectDraw on a multi monitor system

5. Playing sinlge(or multiple) .avi on DirectDraw

hy there!


well, i'm woundering how to play 2 or more .avi files on DirectDraw
surface.....cos i'm trying to make a main menu (for a game), and menu items
should be .avi files......

so please help....


6. Multiple monitors and D3DERR_DEVICELOST

7. Sharing textures with multiple monitors

I have two displays on one video card.  It seems there should be a way to
load textures and use them on both devices but I can't figure out how.

Thanks in Advance.


8. Rendering Across Multiple Monitors