Git Product home page Git Product logo

Comments (4)

mrhelmut avatar mrhelmut commented on June 1, 2024 8

Following the foundation meeting of March 14, the applications have been reviewed and this bounty has been locked for @tomspilman to complete.

from monogame.

mrhelmut avatar mrhelmut commented on June 1, 2024 3

DllImport works just fine with NativeAOT. Maybe some other ahead-of-time environments don't, but we already shipped games using DllImport and NativeAOT so we should be all fine.

(NativeAOT has modes which are stricter and might require that, but it is not required to go as far as that on consoles with MonoGame.)

from monogame.

Jure-BB avatar Jure-BB commented on June 1, 2024

Hello. Just a little nitpick. I think that the new LibraryImport is probably more appropriate than the DllImport, since NativeAOT is the target.

Using DllImport isn't an option for platforms that require full Native AOT scenarios and therefore using other approaches (for example, source generation) is more appropriate.
...
The P/Invoke source generator, included with the .NET 7 SDK and enabled by default, looks for LibraryImportAttribute on a static and partial method to trigger compile-time source generation of marshalling code, removing the need for the generation of an IL stub at run time and allowing the P/Invoke to be inlined.

https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation

from monogame.

Jure-BB avatar Jure-BB commented on June 1, 2024

You're right. DllImport doesn't work only in full NativeAOT.

from monogame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.