gpu_get_blendmode

此函数可用于检索用于绘制的当前混合模式。返回的值将是以下常量之一(默认值为bm_normal):

混合模式常量
常量描述Extended 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

 

语法:

gpu_get_blendmode();

 

返回:

混合模式常量 (see above for constants)

 

例子:

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

以上代码获取当前混合模式,如果不是bm_normal,则设置为该常量。