Cooperative Levels

Send Feedback

Cooperative levels describe how DirectDraw interacts with the display and how it reacts to events that might affect the display. Use the IDirectDraw::SetCooperativeLevel method to set cooperative level of DirectDraw.

For the most part, you use DirectDraw cooperative levels to determine whether your application runs as a full-screen program with exclusive access to the display or as a windowed application. However, DirectDraw cooperative levels can also have the following effects:

  • Prevent DirectDraw from releasing exclusive control of the display.
  • Enable DirectDraw to minimize or maximize the application in response to activation events.

The normal cooperative level indicates that your DirectDraw application will operate as a windowed application. At this cooperative level you will not be able to perform page flipping.

Because applications can use DirectDraw with multiple windows, IDirectDraw::SetCooperativeLevel does not require a window handle to be specified if the application is requesting the DDSCL_NORMAL mode. By passing a NULL to the window handle, all of the windows can be used simultaneously in normal Windows mode.

At the full-screen and exclusive cooperative level, you can use the hardware to its fullest. In this mode, you can implement page flipping.

The exclusive (full-screen) mode prevents other applications from allocating some surface types and from drawing to the primary display. The exclusive mode also prevents other windows on the system from coming to the foreground, so DirectDraw applications must watch for system events (such as incoming phone calls) so they can relinquish control back to the system when necessary.

SetCooperativeLevel maintains a binding between a process and a window handle. If SetCooperativeLevel is called once in a process, a binding is established between the process and the window.

See Also

Testing Cooperative Levels

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.