Direct DrawCreate Clipper

This function creates a DirectDrawClipper object, which describes a clipping area on the screen. DirectX supports two types of DirectDrawClipper objects: dependent and independent. Using this function creates an independent DirectDrawClipper object. A developer would use the IDirectDraw7.CreateClipper() method to create a dependent object.

The advantage of using an independent DirectDrawClipper object is that you can clip an area in any DirectDraw object. The disadvantage is that you have to manually release the object reference or wait until DirectX does it for you when the application terminates. When an application uses a dependent DirectDrawClipper object, the object is destroyed along with the DirectDraw object. There's less chance of a memory leak when you use this method of working with the DirectDrawClipper object, but this method could use more resources.

The Platform SDK documentation shows three arguments for the DirectDrawCreateClipper() function. However, only the second argument, lplpDDClipper, is actually used _by the function. This argument contains a pointer to a DirectDrawClipper object. You must set the dwFlags argument to 0 and the pUnkOuter argument to null. The dwFlags argument could eventually modify the behavior of this function, much as using the special flag values for the DirectDrawCreate() and DirectDrawCreateEx() functions modifies their behavior. Likewise, the pUnkOuter argument will provide aggregation support in a future version of DirectX.

Was this article helpful?

0 0

Post a comment