Skip to content

Commit

Permalink
Merge branch 'MonoGame:main' into feature/link-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AristurtleDev authored May 23, 2024
2 parents 4abe749 + 76949a9 commit 0fb9933
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sudo apt install wine64 p7zip-full curl
Create wine prefix:

```sh
wget -qO- https://raw.githubusercontent.com/MonoGame/MonoGame/master/Tools/MonoGame.Effect.Compiler/mgfxc_wine_setup.sh | bash
wget -qO- https://monogame.net/downloads/net6_mgfxc_wine_setup.sh | bash
```

If you ever need to undo the script, simply delete the `.winemonogame` folder in your home directory.
Expand Down
9 changes: 8 additions & 1 deletion articles/preparing_for_consoles.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,19 @@ Loading assemblies at runtime with `Assembly.Load()` is not supported.

## Third party libraries

Many third party libraries heavily rely on using reflection or IL emit, this is a common practice for JSON or XML parsers for example.
Many third party libraries heavily rely on using reflection or IL emit, this is a common practice for JSON or XML parsers for example (and they are the most common source of third party incompatibilities).

It is advised to choose very carefully the libraries that you are using when porting to consoles. If you do not select them with this in mind, you might run into a situation in which you will have to rewrite entire chunks of data handling.

The best way to make sure if they will work, is to search if they are **"AOT-compatible"**, or try to compile with the `<EnableTrimAnalyzer>true</EnableTrimAnalyzer>` setting in your `.csproj` and check if there are any warnings related to those libraries.

For example, here are some parsing libraries known for their compliance with AOT compilation and good handling of memrory:

- [TurboXML](https://github.com/xoofx/TurboXml)
- [TinyJSON](https://github.com/zanders3/json)

On the contrary, Newtonsoft JSON is known to be unsupported (there are modified forks around, but we overall recommend to not use it for games).

## Native libraries

If you are using native libraries, make sure that they provide builds for consoles, or make sure that you can compile and run them on consoles yourself.
Expand Down

0 comments on commit 0fb9933

Please sign in to comment.