Presenting a Scene
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:
Front Buffer. A rectangle of memory that is translated by the graphics adapter and displayed on the monitor or other output device.
Back Buffer. A surface whose contents can be promoted to the front buffer.
Swap Chain. A collection of back buffers that can be serially presented to the front buffer. Typically, a full-screen swap chain presents subsequent images with the flipping DDI, and a windowed swap chain presents images with the blitting DDI.
Because Microsoft® Direct3D® Mobile has one swap chain as a property of the device, there is always at least one swap chain per device. The IDirect3DMobileDevice interface 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 Mobile API. As a result, applications cannot lock or render to the front buffer.
A call to IDirect3DMobile::CreateDevice represents an implicit reset of the device. Direct3D Mobile has no notion of a primary surface; you cannot create an object that represents the primary surface. It is considered to be an internal property of the device.
In addition to the swap chain that is owned and manipulated through the Direct3DMobileDevice object, an application can use the IDirect3DMobileDevice::CreateAdditionalSwapChain method to create additional swap chains to present multiple views from the same device.
Typically, the application creates one swap chain per view, and it associates each swap chain with a particular view. The application renders images in the back buffers of each swap chain, and then uses the IDirect3DMobileDevice::Present method to present them individually. Note that only one swap chain at a time can be full-screen on each adapter.
Accessing the front buffer is allowed through the IDirect3DMobileDevice::GetFrontBuffer method. Although this method is provided, it is intended explicitly for testing requirements. Thus, its functionality is not guaranteed.