surface_get_depth_disable


语法:

surface_get_depth_disable();


返回:

Boolean(布尔值)


描述

This function checks to see if the automatic depth buffer generation for all surfaces is enabled. Normally all surfaces have depth buffers so if you draw 3D objects to them then it'll sort them properly by depth, however allocating depth buffers essentially doubles the size of surfaces, which could be an excessive and unnecessary overhead especially if your game is very memory intensive. In that case you can check this using this function and disable the depth buffer for surfaces if required using the function surface_depth_disable().

NOTE: This function is currently only valid for the Sony Playstation 4 target platform.


例如:

if surface_get_depth_disable() == false
    {
    surface_depth_disable(true);
    }

The above code will check the current state of the surface depth buffer and if it is enabled, it will disable it instead.