public mupen64plusInputApi(mupen64plusApi core) { InpDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_INPUT, "mupen64plus-input-bkm.dll"); mupen64plusApi.m64p_error result; InpSetInputCallback = (SetInputCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetInputCallback"), typeof(SetInputCallback)); InpSetRumbleCallback = (SetRumbleCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetRumbleCallback"), typeof(SetRumbleCallback)); InpSetControllerPakType = (SetControllerPakType)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerPakType"), typeof(SetControllerPakType)); InpSetControllerConnected = (SetControllerConnected)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerConnected"), typeof(SetControllerConnected)); m64pRumbleCallback = new RumbleCallback(FireOnRumbleChange); result = InpSetRumbleCallback(m64pRumbleCallback); }
public mupen64plusInputApi(mupen64plusApi core) { T GetInputDelegate <T>(string proc) where T : Delegate => mupen64plusApi.GetTypedDelegate <T>(InpDll, proc); InpDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_INPUT, "mupen64plus-input-bkm.dll"); mupen64plusApi.m64p_error result; InpSetInputCallback = GetInputDelegate <SetInputCallback>("SetInputCallback"); InpSetRumbleCallback = GetInputDelegate <SetRumbleCallback>("SetRumbleCallback"); InpSetControllerPakType = GetInputDelegate <SetControllerPakType>("SetControllerPakType"); InpSetControllerConnected = GetInputDelegate <SetControllerConnected>("SetControllerConnected"); m64pRumbleCallback = new RumbleCallback(FireOnRumbleChange); result = InpSetRumbleCallback(m64pRumbleCallback); }
public void SetM64PInputCallbacks(InputCallback inputCallback, RumbleCallback rumbleCallback) { InpSetInputCallback(InpInputCallback = inputCallback); _ = InpSetRumbleCallback(m64pRumbleCallback = rumbleCallback); }