Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6132893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:09:33+00:00 2026-05-23T17:09:33+00:00

Following on from my last question on optimization I’m finding it easier to believe

  • 0

Following on from my last question on optimization I’m finding it easier to believe that it’s simply not possible to optimize my code further to get better performance in my game.

So now I have a new idea and would like to know if it’s possible or even worthwhile to implement. Since the clear bottleneck in performance is from the physics processing which is based in .net, I was thinking, would it be possible to fit in an objective-c or C++ based physics engine (such as box2D) to interact with Mono?

For example in the Mono code I would do something like CreateBox() but behind the scenes the box is created in Obj-C/C++. Or when I do a physics update, I simply call the function in Mono and the brunt work happens in Obj-C/C++

If this is possible can anyone point me in the right direction to get started?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:09:33+00:00Added an answer on May 23, 2026 at 5:09 pm

    Yes.

    There are two ways to do this, via a C API and an Objective-C API.

    With a C API, write your native code in C (or C++ with extern "C"), compile your code into a static library, link your MonoTouch app against the static library, then use P/Invoke to access your C functions. However, unlike “normal” P/Invoke where you need to specify a library name, you need to specify "__Internal" as the library name:

    [DllImport ("__Internal")]
    static extern void MethodInStaticLibrary ();
    

    This same technique is used by MonoTouch to call from e.g. System.dll into the MonoTouch runtime.

    Using Objective-C is the same-yet-different. Instead of a static library exporting a C ABI, you need a static library exporting an Objective-C ABI, link against the static library, then provide an API binding for your Objective-C library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following on from my last question Sql Server query performance , and discovering that
Swiftly following on from my last TripleDES-related question , here's my TripleDES wrapper code,
Following on from my last question : I've written some code to upgrade a
Following from my last question which @Jon Skeet gave me a lot of help
Following on from my last question What is a Stub , I would really
Following on from my last question here OpenXML looks like it probably does exactly
Following on from my last question , are the AssemblyMajorVersion , AssemblyMinorVersion , AssemblyRevisionNumber
Following up from my last question does anyone know how I can use a
Ref: Forms, Post and submit buttons Following on from my last question, I've attempted
From my last question , I have new idea for database protection. The following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.