Display adapter

G

Guest

Hi,

I'm trying to create an project running in a dual display environment. My
application instantiate a Windows Form on each monitor, and that works great.
However, I need to use DirectX and thereby I need to figure out, which
display adapter the form is running on. Until now that hasn't been easy! I
tried using the Screen class, but if the primary window is to the right, then
the first screen in Screen.AllScreens is the one on the left, and so I can't
just use the index in Screen.AllScreens.

Could anyone please help me figure out how to determine the adapter a form
is running on?

Kindly regards
 
K

Kevin Spencer

Use the Screen.GetWorkingArea method.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 
G

Guest

Hi Kevin,

how should GetWorkingArea help me figure out the display adapter th form is
running on?

--
With regards
Jens Søe Christiansen


Kevin Spencer said:
Use the Screen.GetWorkingArea method.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 
K

Kevin Spencer

Ah, this is a DirectX question?

Is this managed DirectX or native? If managed, use the Device.Device class.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.


Søe said:
Hi Kevin,

how should GetWorkingArea help me figure out the display adapter th form
is
running on?
 
G

Guest

Dar Kevin,

I'm very sorry for my stupidity, but I don't seem to have a device class in
the Device, running manage C# .Net 2.0?

Please advice if possible, since this is very crucial for us.
 
G

Guest

hmmmm hi Kevin,

I'm very sorry but I can't seem to find anything that actually could help me!
 
K

Kevin Spencer

The Device class is part of the Direct3D namespace, which is included in the
SDK, along with all the documentation.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 
G

Guest

Dear Kevin,

I know about the Direct3D. My application is blending and mixing textures
and everything, but I still can't seem to figure out on which display adapter
m form is running, in a multi-dispay environment (specially when the primary
display is to the right)!
 
G

Guest

Dear Kevin,

I know about the Direct3D. My application is blending and mixing textures
and everything, but I still can't seem to figure out on which display adapter
m form is running, in a multi-dispay environment (specially when the primary
display is to the right)!
 
K

Kevin Spencer

See:
http://msdn.microsoft.com/library/d...x9_c/DirectX_9_Frequently_Asked_Questions.asp

The Device is a class that encapsulates access to a display adapter. When
you work with a Device, you are working with a graphics adapter. The FAQ
listed above will tell you how to get the various characteristics of the
various adapters on your system.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
 
G

Guest

Dear Kevin,

I'm very sorry but I don't quite follow you (where to look)!

My problem is that I have a form, and now I would like to create a Direct3D
device, like this:

m_Device = new Dvice(adapter, ......)

How do I determine the adapter the form i running on?
(Ps. I can't use the device constructor that takes an IntPtr, since I can't
set the Presentationparams)
 
K

Kevin Spencer

You need to read the references I sent you. The last one tells you how to
enumerate the various adapters on your system. As to which one you will use,
that's up to you.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top