此函数可用于检索用于绘制的当前混合模式。返回的值将是以下常量之一(默认值为bm_normal):
混合模式常量 | |||
---|---|---|---|
常量 | 描述 | Extended Blend Mode | Blend Equation |
bm_normal | Normal blending (the default blend mode). | (bm_src_alpha, bm_inv_src_alpha) | bm_eq_add |
bm_add | Additive blending. Luminosity values of light areas are added. | (bm_src_alpha, bm_one) | bm_eq_add |
bm_subtract | Subtractive blending. Source is subtracted from the destination. | (bm_src_alpha, bm_one) | bm_eq_subtract |
bm_reverse_subtract | Reverse subtractive blending. Destination is subtracted from the source. | (bm_src_alpha, bm_one) | bm_eq_reverse_subtract |
bm_min | Smaller value from source and destination is selected. | (bm_one, bm_one) | bm_eq_min |
bm_max | Max 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,则设置为该常量。