DirectDraw and Multiple Monitors

[Previous] [Next]

Microsoft Windows 98 introduced the capability to support multiple display devices and monitors on one computer. This capability, sometimes referred to as multimon, allows Windows to use the display areas of two or more monitors as one logical desktop. On a multimon system, you can move windows from one monitor to the next or have a program, through DirectDraw, use multiple display devices. One powerful feature of DirectX is that you can create more than one instance of a DirectDraw object at a time when you have more than one display card installed on your system. Even on computers with operating systems that don't support multiple monitors on their own, such as Microsoft Windows 95 and Microsoft Windows NT 4 (or earlier), you can create a DirectDraw object for each desired display device. When enumerating and creating display devices in DirectDraw, the term DirectDraw device (or sometimes DirectDraw driver) is used to refer to a display device that supports DirectDraw.

The primary display device that Windows uses is also the one that DirectX uses when you create an instance of the default DirectDraw object (the one with a GUID pointer of NULL). You can address the second display device, if it exists, by using its GUID to create a second DirectDraw object. You can acquire this GUID by using the DirectDrawEnumerateEx function, which I'll describe later in this chapter.

One or more of the display cards that are installed might support hardware 3D acceleration. You choose whether to use 3D acceleration on a given DirectDraw device by enumerating its Direct3D devices and then selecting one. A Direct3D device, as we'll discuss further in Chapter 4, is a Direct3D object that holds rendering state information and represents a way to render 3D scenes. Unlike a DirectDraw device, a Direct3D device doesn't necessarily represent a physical piece of hardware—it can be either a software-based renderer or a hardware-accelerated renderer.

Figure 3-1 shows an example system with multiple DirectDraw devices and multiple Direct3D devices available on each DirectDraw device.

click to view at full size.

Figure 3-1 Multiple display cards connected to multiple monitors

Before doing any 3D rendering, you have to make two choices: first, which display device do you want to use? And second, for a given display device, which 3D renderer do you want to use? A Direct3D program should pick reasonable defaults for the display device and renderer but also allow users to change to a different display device and renderer if they don't like the default choice. After reading this chapter and the next one, you'll see how to implement this functionality.



Inside Direct3D
Inside Direct3D (Dv-Mps Inside)
ISBN: 0735606137
EAN: 2147483647
Year: 1999
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net