gpu_set_zfunc

This function can be used to set the z-buffer testing comparison mode (see gpu_set_ztestenable() for more information). The values available for use are any of the following constants (the default value is cmpfunc_lessequal):

ConstantDescription
cmpfunc_neverNever
cmpfunc_lessLess
cmpfunc_equalEqual
cmpfunc_lessequalLess or Equal
cmpfunc_greaterGreater
cmpfunc_notequalNot Equal
cmpfunc_greaterequalGreater or Equal
cmpfunc_alwaysAlways

 

Syntax:

gpu_set_zfunc(cmp_func);

ArgumentTypeDescription
cmp_funcComparison Function ConstantThe comparison mode to use (see list above)

 

Returns:

N/A

 

Example:

gpu_set_ztestenable(true);
gpu_set_zfunc(cmpfunc_always);
draw_sprite(spr_Background, 0, 0, 0);
gpu_set_ztestenable(false);

The above code switches on z-buffer testing and sets its comparison mode before drawing a background sprite and then switches it back off again to continue drawing.