Direct3D Mobile Cooperative Levels
A version of this page is also available for
4/8/2010
Even though there can only be one Direct3D Mobile application running on a Windows Embedded CE-based device at any one time, other applications using other Windows Embedded CE system graphics APIs may also be running on the target device as well. As a result, the Direct3D Mobile API must cooperate with other graphics APIs on the device to negotiate for access to the physical display.
The Windowed member of the D3DMPRESENT_PARAMETERS structure defines the graphics device that a Direct3D Mobile application is using should cooperate with other applications running on the Windows Embedded CE-based device. The Direct3D Mobile application will run in full screen mode if this member is set to FALSE, otherwise it will run in windowed mode. Cooperative levels are implemented entirely within the Direct3D Mobile middleware. There is no need, or possibility, for the application to do anything other than specify the mode.
Full Screen Mode
When using full screen mode, Direct3D Mobile prevents all other graphics APIs from being able to draw on the screen. Other graphics APIs may still do off-screen processing, but their displays will not be shown. The entire screen associated with the device is valid to draw on using the Direct3D Mobile API. The only exception to this rule is that if the Direct3D Mobile driver supports locking the primary surface, then it is possible to get a handle to a GDI Device Context (HDC), which refers to the primary surface and use that as the target for drawing operations.
Windowed Mode
When using windowed mode, the Direct3D Mobile API may only present its back buffer into the client area of the focus window passed as part of the call to the IDirect3DMobile::CreateDevice method. Flipping is not supported when an application is running in windowed mode. As a result, the data from the back buffer can only presented by blitting it into the window's client area. Such a blit operation is subject to normal windowing clipping processes.
While it is possible to draw into the window's client area using GDI (outside of the Direct3D Mobile GetDC context), it is not recommended as there is no mechanism to keep such drawing operations synchronized, and the order in which such operations may occur is undefined.
While in windowed mode, it is the application's responsibility to handle WM_PAINT and WM_SIZE messages appropriately. A presentation time, the Direct3D Mobile middleware will gather the appropriate clip list based on the windows that are on top of the application window and make sure that IDirect3DMobileDevice::Present draws only in the visible parts of the window's client area.