// <auto-generated>
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
// </auto-generated>

namespace Ghost.Ufbx;

public unsafe partial struct ufbx_geometry_cache : System.IDisposable
{
    /// <summary>
    /// From: <see cref="Api.ufbx_load_geometry_cache(sbyte*, ufbx_geometry_cache_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_geometry_cache* Load(sbyte* filename, ufbx_geometry_cache_opts* opts, ufbx_error* error)
    {
        return Api.ufbx_load_geometry_cache(
            filename,
            opts,
            error);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_load_geometry_cache_len(sbyte*, nuint, ufbx_geometry_cache_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_geometry_cache* LoadLen(ReadOnlySpan<byte> filename, ufbx_geometry_cache_opts* opts, ufbx_error* error)
    {
        fixed (byte* pfilename = filename)
        {
            return Api.ufbx_load_geometry_cache_len(
                (sbyte*)pfilename,
                (nuint)filename.Length,
                opts,
                error);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_free_geometry_cache(ufbx_geometry_cache*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public void Dispose()
    {
        Api.ufbx_free_geometry_cache((ufbx_geometry_cache*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_retain_geometry_cache(ufbx_geometry_cache*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public void Retain()
    {
        Api.ufbx_retain_geometry_cache((ufbx_geometry_cache*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
    }
}
