Microsoft DirectX 8.1 (Visual Basic) |
The presentation application programming interfaces (APIs) are a set of methods that control the state of the device that affects what the user sees on the monitor. These methods include setting display modes and once-per-frame methods that are used to present images to the user.
Familiarity with the following terms is necessary to understand the presentation APIs.
Because Microsoft® Direct3D® Microsoft for DirectX® 8.x has one swap chain as a property of the device, there is always at least one swap chain per device. The Direct3DDevice8 class has a set of methods that manipulate the implicit swap chain and are a copy of the swap chain's own interface. Applications can create additional swap chains; however, this is not necessary for the typical single window or full-screen application.
The front buffer is not directly exposed in the Direct3D API for DirectX 8.x. As a result, applications cannot lock or render to the front buffer. For details, see Accessing the Color Front Buffer.
Note DirectX 7.x provided a number of presentation APIs that were called together. A good example of this is the DirectDraw7.SetCooperativeLevel, DirectDraw7.SetDisplayMode, and DirectDraw7.CreateSurface sequence. Additionally, the DirectDrawSurface7.Flip and DirectDrawSurface7.Blt methods signaled the transport of rendered frames to the monitor. DirectX 8.x collapses these groups of APIs into two main methods, Reset and Present. Reset subsumes SetCooperativeLevel, SetDisplayMode, CreateSurface, and some of the parameters to Flip. Present subsumes Flip and the presentation uses of Blt.
A call to Direct3D8.CreateDevice represents an implicit reset of the device. The DirectX 8.x API has no notion of a primary surface; you cannot to create an object that represents the primary surface. It is considered to be an internal property of the device.
Gamma ramps are associated with a swap chain and are manipulated with the Direct3DDevice8.GetGammaRamp and Direct3DDevice8.SetGammaRamp methods.