Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for il2cpp and iOS #37

Merged
merged 1 commit into from Jan 9, 2022
Merged

Add support for il2cpp and iOS #37

merged 1 commit into from Jan 9, 2022

Conversation

jsm174
Copy link
Collaborator

@jsm174 jsm174 commented Jan 9, 2022

While trying to get Visual Pinball Engine running on iOS, I ran into following error:

VisualPinball.Engine.PinMAME.PinMameGamelogicEngine:OnInit(Player, TableApi, BallManager)
NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we're attempting to marshal is: PinMame.PinMame::OnStateUpdatedCallback
  at PinMame.PinMameApi.PinmameSetConfig (PinMame.PinMameApi+PinmameConfig& config) [0x00000] in <00000000000000000000000000000000>:0 

After updating the callbacks to be static, another error occurred:

To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition

After reviewing discord/discord-rpc#186 I was able to implement MonoPInvokeCallbackAttribute.cs from this repo.

Todo:

  • Better way of doing the static methods?
  • Test in Windows + Mac.

@jsm174 jsm174 changed the title Add support for il2cpp and ios Add support for il2cpp and iOS Jan 9, 2022
@jsm174 jsm174 requested a review from freezy January 9, 2022 13:11
@jsm174 jsm174 force-pushed the feature/il2cpp branch 5 times, most recently from 7321f59 to bdb4284 Compare January 9, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant