$(U BlendMode) is a structure that represents a blend mode. A blend mode
determines how the colors of an object you draw are mixed with the colors
that are already in the buffer.
The class is composed of 6 components, each of which has its
own public member variable:
Color Source Factor (colorSrcFactor)
Color Destination Factor (colorDstFactor)
Color Blend Equation (colorEquation)
Alpha Source Factor (alphaSrcFactor)
Alpha Destination Factor (alphaDstFactor)
Alpha Blend Equation (alphaEquation)
$(PARA
The source factor specifies how the pixel you are drawing contributes to the
final color. The destination factor specifies how the pixel already drawn in
the buffer contributes to the final color.
The color channels RGB (red, green, blue; simply referred to as color) and A
(alpha; the transparency) can be treated separately. This separation can be
useful for specific blend modes, but most often you won't need it and will
simply treat the color as a single unit.
The blend factors and equations correspond to their OpenGL equivalents. In
general, the color of the resulting pixel is calculated according to the
following formula ($(I src) is the color of the source pixel, $(I dst) the
color of the destination pixel, the other variables correspond to the
public members, with the equations being `+` or `-` operators):)
$(PARA All factors and colors are represented as floating point numbers
between 0 and 1. Where necessary, the result is clamped to fit in that range.
The most common blending modes are defined as constants inside of
$(U BlendMode):)
$(PARA In DSFML, a blend mode can be specified every time you draw a Drawable
object to a render target. It is part of the RenderStates compound
that is passed to the member function RenderTarget::draw().)
$(U BlendMode) is a structure that represents a blend mode. A blend mode determines how the colors of an object you draw are mixed with the colors that are already in the buffer.
The class is composed of 6 components, each of which has its own public member variable:
$(PARA The source factor specifies how the pixel you are drawing contributes to the final color. The destination factor specifies how the pixel already drawn in the buffer contributes to the final color. The color channels RGB (red, green, blue; simply referred to as color) and A (alpha; the transparency) can be treated separately. This separation can be useful for specific blend modes, but most often you won't need it and will simply treat the color as a single unit. The blend factors and equations correspond to their OpenGL equivalents. In general, the color of the resulting pixel is calculated according to the following formula ($(I src) is the color of the source pixel, $(I dst) the color of the destination pixel, the other variables correspond to the public members, with the equations being `+` or `-` operators):)
$(PARA All factors and colors are represented as floating point numbers between 0 and 1. Where necessary, the result is clamped to fit in that range. The most common blending modes are defined as constants inside of $(U BlendMode):)
$(PARA In DSFML, a blend mode can be specified every time you draw a Drawable object to a render target. It is part of the RenderStates compound that is passed to the member function RenderTarget::draw().)