gpu_get_blendmode

This function can be used to retrieve the current blend mode being used for drawing. The returned value will be one of the following constants (the default value is bm_normal):

Blend Mode Constant
ConstantDescriptionExtended Blend ModeBlend Equation
bm_normalNormal blending (the default blend mode).(bm_src_alpha, bm_inv_src_alpha)bm_eq_add
bm_addAdditive blending. Luminosity values of light areas are added.(bm_src_alpha, bm_one)bm_eq_add
bm_subtractSubtractive blending. Source is subtracted from the destination.(bm_src_alpha, bm_one)bm_eq_subtract
bm_reverse_subtractReverse subtractive blending. Destination is subtracted from the source.(bm_src_alpha, bm_one)bm_eq_reverse_subtract
bm_minSmaller value from source and destination is selected.(bm_one, bm_one)bm_eq_min
bm_maxMax blending. Similar to additive blending.(bm_src_alpha, bm_inv_src_colour)bm_eq_add

 

Syntax:

gpu_get_blendmode();

 

Returns:

Blend Mode Constant (see above for constants)

 

Example:

if (gpu_get_blendmode() != bm_normal)
{
    gpu_set_blendmode(bm_normal);
}

The above code gets the current blend mode and if it is not bm_normal it is set to that constant.