Game Development Reference
In-Depth Information
chapter 25
Using Direct3D Swap
Chains with MDI
Mostly, when you see programmers, they aren't doing anything. One of the
attractive things about programmers is that you cannot tell whether or not
they are working simply by looking at them. Very often they're sitting there
seemingly drinking coffee and gossiping, or just staring into space. What the
programmer is trying to do is get a handle on all the individual and unre-
lated ideas that are scampering around in his head.
Charles M. Strauss
Almost every game displays itself in a single window, which is a single active device
within Direct3D. Many tools, on the other hand, display multiple windows to the
users so they may view multiple aspects of the game when designing content. The
core purpose of Direct3D is to serve as a high-performance 3D API for real-time
games, and because of this, it was designed to be most efficient rendering to a single
device. Using a device for every display window in an editor or tool would be
extremely inefficient and negatively affect performance.
The efficient way of rendering to multiple windows (or contexts) with a single
Direct3D device is through the use of swap chains. Unfortunately, there are a
scarce number of examples showing how to use them, and the SDK documenta-
tion is extremely vague. The purpose of this chapter is to fill the gap and provide
you with extensive information about using swap chains within an MDI (or SDI)
Search Nedrilad ::

Custom Search