public string FunctionParams; /* Function parameters that the error ocurred on */ public ErrorCallbackInfo(ref ErrorCallbackInfoNative native) { Result = native.Result; InstanceType = native.InstanceType; Instance = native.Instance; FunctionName = FmodHelpers.PtrToStringUnknownSize(native.FunctionName); FunctionParams = FmodHelpers.PtrToStringUnknownSize(native.FunctionParams); }
public unsafe DriverInfo GetDriverInfo(int DriverId) { const int AllocSize = Fmod.MaxInteropNameStringLength; Guid guid; int rate, channels; SpeakerMode mode; var NamePtr = stackalloc byte[AllocSize]; library.System_GetDriverInfo(Handle, DriverId, NamePtr, AllocSize, &guid, &rate, &mode, &channels).CheckResult(); return(new DriverInfo(FmodHelpers.BufferToString(NamePtr, AllocSize), guid, rate, mode, channels)); }
public unsafe PluginInfo GetPluginInfo(PluginHandle plugin) { const int buflen = Fmod.MaxInteropNameStringLength; byte * buffer = stackalloc byte[buflen]; PluginType type; FmodVersion version; library.System_GetPluginInfo(Handle, plugin, &type, buffer, buflen, &version).CheckResult(); string name = FmodHelpers.BufferToString(buffer, buflen); return(new PluginInfo(name, type, version)); }
private static Result DebugCallbackMarshaller(DebugFlags flags, byte *file, int line, byte *func, byte *message) { if (DebugCallbackReference is null) { return(Result.Ok); } try { var fileString = FmodHelpers.PtrToStringUnknownSize(file); var funcString = FmodHelpers.PtrToStringUnknownSize(func); var messageString = FmodHelpers.PtrToStringUnknownSize(message); return(DebugCallbackReference.Invoke(flags, fileString, line, funcString, messageString)); } catch (FmodException fe) { return(fe.Result ?? Result.Err_Internal); } catch { return(Result.Err_Internal); } }