forked from Misaki/GhostEngine
Major overhaul of native wrapper generation for ufbx and nvtt. Replaces all hand-written and class-based wrappers with auto-generated partial struct wrappers that directly expose native API methods via pointers. Introduces a new JSON-driven configuration system using "remaps" and "actions" for flexible parameter/return mapping and method routing. Removes legacy config sections and helper classes, focusing solely on method wrappers. Updates all usages and tests to use the new pointer-based API. Cleans up obsolete code and ensures resource management is handled via struct Dispose methods. The result is a thinner, more direct, and maintainable interop layer. BREAKING CHANGE: All managed wrapper classes and helpers are removed in favor of struct-based pointer wrappers. API usage and resource management patterns have changed.
108 lines
3.7 KiB
C#
108 lines
3.7 KiB
C#
// <auto-generated>
|
|
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
|
|
// </auto-generated>
|
|
|
|
namespace Ghost.Nvtt;
|
|
|
|
public unsafe partial struct NvttSurfaceSet : System.IDisposable
|
|
{
|
|
// From: nvttCreateSurfaceSet()
|
|
public static NvttSurfaceSet* Create()
|
|
{
|
|
return Api.nvttCreateSurfaceSet();
|
|
}
|
|
|
|
// From: nvttDestroySurfaceSet(NvttSurfaceSet*)
|
|
public void Dispose()
|
|
{
|
|
Api.nvttDestroySurfaceSet((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttResetSurfaceSet(NvttSurfaceSet*)
|
|
public void Reset()
|
|
{
|
|
Api.nvttResetSurfaceSet((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetTextureType(NvttSurfaceSet*)
|
|
public NvttTextureType GetTextureType()
|
|
{
|
|
return Api.nvttSurfaceSetGetTextureType((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetFaceCount(NvttSurfaceSet*)
|
|
public int GetFaceCount()
|
|
{
|
|
return Api.nvttSurfaceSetGetFaceCount((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetMipmapCount(NvttSurfaceSet*)
|
|
public int GetMipmapCount()
|
|
{
|
|
return Api.nvttSurfaceSetGetMipmapCount((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetWidth(NvttSurfaceSet*)
|
|
public int GetWidth()
|
|
{
|
|
return Api.nvttSurfaceSetGetWidth((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetHeight(NvttSurfaceSet*)
|
|
public int GetHeight()
|
|
{
|
|
return Api.nvttSurfaceSetGetHeight((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetDepth(NvttSurfaceSet*)
|
|
public int GetDepth()
|
|
{
|
|
return Api.nvttSurfaceSetGetDepth((NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
|
}
|
|
|
|
// From: nvttSurfaceSetGetSurface(NvttSurfaceSet*, int, int, NvttBoolean)
|
|
public NvttSurface* GetSurface(int faceId, int mipId, NvttBoolean expectSigned)
|
|
{
|
|
return Api.nvttSurfaceSetGetSurface(
|
|
(NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
faceId,
|
|
mipId,
|
|
expectSigned);
|
|
}
|
|
|
|
// From: nvttSurfaceSetLoadDDS(NvttSurfaceSet*, sbyte*, NvttBoolean)
|
|
public NvttBoolean LoadDDS(ReadOnlySpan<byte> fileName, NvttBoolean forcenormal)
|
|
{
|
|
fixed (byte* pfileName = fileName)
|
|
{
|
|
return Api.nvttSurfaceSetLoadDDS(
|
|
(NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
(sbyte*)pfileName,
|
|
forcenormal);
|
|
}
|
|
}
|
|
|
|
// From: nvttSurfaceSetLoadDDSFromMemory(NvttSurfaceSet*, void*, ulong, NvttBoolean)
|
|
public NvttBoolean LoadDDSFromMemory(void* data, ulong sizeInBytes, NvttBoolean forcenormal)
|
|
{
|
|
return Api.nvttSurfaceSetLoadDDSFromMemory(
|
|
(NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
data,
|
|
sizeInBytes,
|
|
forcenormal);
|
|
}
|
|
|
|
// From: nvttSurfaceSetSaveImage(NvttSurfaceSet*, sbyte*, int, int)
|
|
public NvttBoolean SaveImage(ReadOnlySpan<byte> fileName, int faceId, int mipId)
|
|
{
|
|
fixed (byte* pfileName = fileName)
|
|
{
|
|
return Api.nvttSurfaceSetSaveImage(
|
|
(NvttSurfaceSet*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
|
(sbyte*)pfileName,
|
|
faceId,
|
|
mipId);
|
|
}
|
|
}
|
|
}
|