surface_format_is_supported

This function returns whether the given surface format is supported on the current platform. All formats are listed here.

 

Syntax:

surface_format_is_supported(format);

ArgumentTypeDescription
formatSurface Format ConstantThe surface format to check

 

Returns:

Boolean

 

Example:

if (surface_format_is_supported(surface_rgba32float))
{
    my_surf = surface_create(320, 180, surface_rgba32float);
    // ...
}
else
{
    show_debug_message("Effect disabled, 32-bit surface not supported");
}

This checks if the surface_rgba32float format is supported on the current platform, and in that case it creates a surface with that format. However, if the format is not supported, it instead prints a message to the output log.