Platform SDK: DirectX |
Through the gamma and color control interfaces, DirectDrawSurface objects enable you to change how the system displays the contents of the surface, without affecting the contents of the surface itself. You can think of these controls as very simple filters that DirectDraw applies to the data as it leaves a surface before being rendered on the screen. Surface objects implement the IDirectDrawGammaControl and IDirectDrawColorControl interfaces which expose methods to adjust how the surface's contents are filtered. You can retrieve a pointer to either interface by using the IUnknown::QueryInterface method of the target surface, specifying the IID_IDirectDrawGammaControl or IID_IDirectDrawColorControl reference identifiers.
Gamma controls, represented by the IDirectDrawGammaControl interface, make it possible for you to dynamically change how a surface's individual red, green, and blue levels map to the actual levels that the system displays. By setting gamma levels, you can cause the user's screen to flash colors—red when the user's character is shot, green when they pick up a new item, and so on—without blitting new images to the frame buffer to achieve the effect. Or, you might adjust color levels to apply a color bias to the images in the frame buffer. Although this interface is similar to the color control interface, this one is the easiest to use, making it the best choice for game applications. For details, see Using Gamma Controls.
The IDirectDrawColorControl interface allows you to control color in a surface much like the color controls you might find on a television. The similarity between IDirectDrawColorControl and the actual controls on a TV is no mistake—this interface is most appropriate for adjusting how broadcast video looks in an overlay surface, so it makes sense that it should provide similar control over colors. You can use color controls to allow a user to change video characteristics such as hue, saturation, contrast, and several others. For more information, see Using Color Controls.
Through the gamma and color control objects, DirectDrawSurface objects enable you to change how the system displays the contents of the surface, without affecting the contents of the surface itself. You can think of these controls as very simple filters that DirectDraw applies to the data as it leaves a surface before being rendered on the screen. The DirectDrawGammaControl and DirectDrawColorControl objects provide methods to adjust how the surface's contents are filtered. You can create these objects by using the DirectDrawSurface7.GetDirectDrawColorControl and DirectDrawSurface7.GetDirectDrawGammaControl methods of the target surface.
Gamma controls, represented by the DirectDrawGammaControl class, make it possible for you to dynamically change how a surface's individual red, green, and blue levels map to the actual levels that the system displays. By setting gamma levels, you can cause the user's screen to flash colors—red when the user's character is shot, green when they pick up a new item, and so on—without blitting new images to the frame buffer to achieve the effect. Or, you might adjust color levels to apply a color bias to the images in the frame buffer. Although this class is similar to the color control class, this one is the easiest to use, making it the best choice for game applications. For details, see Using Gamma Controls.
The DirectDrawColorControl class allows you to control color in a surface much like the color controls you might find on a television. The similarity between DirectDrawColorControl and the actual controls on a TV is no mistake—this class is most appropriate for adjusting how broadcast video looks in an overlay surface, so it makes sense that it should provide similar control over colors. You can use color controls to allow a user to change video characteristics such as hue, saturation, contrast, and several others. For more information, see Using Color Controls.