public static TextureWrapMode ToOpenTk(this MatlWrapMode wrapMode) { return(wrapMode switch { MatlWrapMode.Repeat => TextureWrapMode.Repeat, MatlWrapMode.ClampToEdge => TextureWrapMode.ClampToEdge, MatlWrapMode.MirroredRepeat => TextureWrapMode.MirroredRepeat, MatlWrapMode.ClampToBorder => TextureWrapMode.ClampToBorder, _ => throw new NotSupportedException($"Unsupported conversion for {wrapMode}"), });
public static TextureWrapMode GetWrapMode(MatlWrapMode wrapMode) { if (wrapMode == MatlWrapMode.Repeat) { return(TextureWrapMode.Repeat); } if (wrapMode == MatlWrapMode.ClampToEdge) { return(TextureWrapMode.ClampToEdge); } if (wrapMode == MatlWrapMode.MirroredRepeat) { return(TextureWrapMode.MirroredRepeat); } if (wrapMode == MatlWrapMode.ClampToBorder) { return(TextureWrapMode.ClampToBorder); } return(TextureWrapMode.ClampToEdge); }