gpu_get_zfunc

This function can be used to retrieve the z comparison mode. The value returned will be one of the following constants (the default value is cmpfunc_lessequal):

Comparison Function Constant
ConstantDescription
cmpfunc_neverNever
cmpfunc_lessLess
cmpfunc_equalEqual
cmpfunc_lessequalLess or Equal
cmpfunc_greaterGreater
cmpfunc_notequalNot Equal
cmpfunc_greaterequalGreater or Equal
cmpfunc_alwaysAlways

 

Syntax:

gpu_get_zfunc();

 

Returns:

Comparison Function Constant (see table above)

 

Example:

if (gpu_get_zfunc() != cmpfunc_greater)
{
    gpu_set_zfunc(cmpfunc_greater);
}

The above code checks to see if the z-testing method is set to cmpfunc_greater and if not then it is set to that constant.