matyalatte / Texconv-Custom-DLL

Cross-platform implementation for Texconv and Texassemble.
MIT License
17 stars 5 forks source link

Thanks! #5

Open LennardF1989 opened 1 year ago

LennardF1989 commented 1 year ago

I needed a version I could easily P/Invoke from C# (.NET 7), thanks! Saves me the trouble.

For those wondering:

[LibraryImport("texconv.dll", EntryPoint = "texconv")]
private static partial int Texconv(
    int argc,
    [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] argv,
    [MarshalAs(UnmanagedType.Bool)] bool verbose,
    [MarshalAs(UnmanagedType.Bool)] bool initCOM,
    [MarshalAs(UnmanagedType.Bool)] bool allowSlowCodec,
    [MarshalAs(UnmanagedType.LPWStr)] string errorBuffer,
    int errorBufferSize = 0
);

How truely cross-platform is this, when Texconv itself uses DirectX interfaces for (parts) of its magic?

matyalatte commented 1 year ago

How truely cross-platform is this, when Texconv itself uses DirectX interfaces for (parts) of its magic?

DirectX team is trying to make it cross-platform. And some features supports unix/linux systems already. For DirectXTex, you can build it on unix/linux systems just by including DirectXMath and DirectX-Headers. So, it was not hard to make texconv cross-platform. I just removed winapi calls and GPU codec from texconv.