You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/3:-Distributing-FNA-Games.md
+1-173Lines changed: 1 addition & 173 deletions
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,6 @@ OS: glibc 2.28+, 64-bit only
20
20
Graphics (Minimum): OpenGL 3.0+ support (2.1 with ARB extensions acceptable)
21
21
Graphics (Recommended): Vulkan support
22
22
23
-
macOS:
24
-
OS: 10.9 Mavericks and newer
25
-
Graphics (Minimum): OpenGL 3.0+ support (2.1 with ARB extensions acceptable)
26
-
Graphics (Recommended): Metal support
27
-
28
23
Other: SDL_GameController devices fully supported
29
24
```
30
25
@@ -120,180 +115,13 @@ A good publicly-available example of this layout is the PC version of [I MAED A
120
115
121
116
***
122
117
123
-
### macOS
124
-
Download the latest version of MonoKickstart:
125
-
126
-
https://github.com/flibitijibibo/MonoKickstart
127
-
128
-
You only need the latest revision; it is actually _not_ recommended to download using Git, as the repository is mostly binary blobs, so the download time will be much longer.
129
-
130
-
In the precompiled/ folder you will notice the following:
* For macOS, you care about all of these except `kick.bin.x86_64`
134
-
* Lots and lots of DLL files.
135
-
* If you don't know which ones you need, just use them all.
136
-
137
-
What follows is really convoluted and annoying, because that's the Apple Way:
138
-
139
-
You'll start by making a series of seemingly-arbitrary folders that will look something like this:
140
-
141
-
```
142
-
flibitGame.app/
143
-
Contents/
144
-
MacOS/
145
-
Resources/
146
-
```
147
-
148
-
Next, you will put `kick.bin.osx` into the `MacOS/` folder and rename it to the name of your main EXE. For example, for `flibitGame.exe` you will name it `flibitGame`, no extension. Next to that you will put the `osx/` folder (NOT ITS CONTENTS) from the [fnalibs.tar.bz2 package](1:-Setting-Up-FNA.md#step-2-download-native-libraries). The `vulkan/` folder from fnalibs.tar.bz2 will go in the `Resources/` folder. Any other native libraries you have will also go in the `osx/` folder (for example, if you're using Steamworks.NET, you would put libsteam_api.dylib in the `osx/` folder). Lastly, if you're shipping on Steam, you will put your `steam_appid.txt` file in `Resources/`.
149
-
150
-
So now your bundle should look like this:
151
-
152
-
```
153
-
flibitGame.app/
154
-
Contents/
155
-
MacOS/
156
-
flibitGame
157
-
osx/
158
-
Resources/
159
-
vulkan/
160
-
steam_appid.txt
161
-
```
162
-
163
-
Now, onto the `Resources/` folder. You will put `monoconfig`, `monomachineconfig`, and the DLL files into this folder.
164
-
165
-
Those DLL files, config files, and `kick.bin.osx` are actually a highly compacted Mono runtime that will be executing the C# assemblies, just as .NET would on Windows. The upside is, there are no system dependencies - the whole runtime is in this one folder, and all the native dependencies are in the lib folder. Convenient!
166
-
167
-
However, note that not every single DLL in the C# standard library exists in this folder. Libs like System.Web.Services are not provided by default to save disk space, but if you need these you can just grab these from any Mono runtime and we'll recognize it. These libs are typically found in the lib/mono/4.x/ folder (the precompiled folder uses 4.5).
168
-
169
-
Finally, you will put _your whole game_ into the `Resources/` folder. After that, the bundle should look like this:
170
-
171
-
```
172
-
flibitGame.app/
173
-
Contents/
174
-
MacOS/
175
-
flibitGame
176
-
osx/
177
-
steam_appid.txt
178
-
Resources/
179
-
vulkan/
180
-
monoconfig
181
-
monomachineconfig
182
-
mscorlib.dll, System.dll, blah blah
183
-
flibitGame.exe
184
-
Content/
185
-
etc...
186
-
```
187
-
188
-
At this point, we're now ready for the Mac-specific data. No, seriously, we haven't even gotten to that part yet.
189
-
190
-
First, you will need to put a `.icns` file in the `Resources/` folder. An icns file can be generated with any image using this website:
191
-
192
-
https://cloudconvert.com/png-to-icns
193
-
194
-
It is _strongly_ recommended that you use an image that is at least 512x512 in size. For certification, Apple actually requires a 4096x4096 image for your icon!
195
-
196
-
The very last file that will be made before your bundle is done is an `Info.plist` file, which will go in the `Contents/` folder. Here's an example Info.plist file:
197
-
198
-
```
199
-
<?xml version="1.0" encoding="UTF-8"?>
200
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Once you've compiled all of this together, you should have a working app bundle! FINALLY! Place your app bundle and any other items you want to include with your game into a folder, then you are ready to upload via [SteamPipe](https://partner.steamgames.com/doc/sdk/uploading), [butler](https://itch.io/docs/butler/), or the [GOG Galaxy builder](https://docs.gog.com/bc-build-game/).
259
-
260
-
One extra note: If for some reason you want to codesign your app (**this is optional**), you will want to have this in an `entitlements.plist` file when signing:
261
-
262
-
```
263
-
<?xml version="1.0" encoding="UTF-8"?>
264
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
When signing for Steam, the first key should be `false`, otherwise it won't be able to detect when Steam is running.
288
-
289
118
### .NET Core
290
119
291
120
The above guide works for .NET Framework and Mono applications, but does not work with .NET 8. The publishing system for modern .NET has completely changed and is described below.
292
121
293
-
`dotnet publish -r <win-x64/linux-x64/osx-x64> -c Release --self-contained` will produce the executable package, but each platform has different requirements for where the fnalibs must be placed.
122
+
`dotnet publish -r <win-x64/linux-x64> -c Release --self-contained` will produce the executable package, but each platform has different requirements for where the fnalibs must be placed.
294
123
295
124
***Windows:** Place the x64 fnalibs in the `publish` directory alongside your executable.
296
-
***MacOS:** Place the osx fnalibs in the `publish` directory alongside your executable. Then use `install_name_tool -add_rpath @executable_path <your_app_executable_name>` to force the application to first look in the executable directory for the fnalibs, instead of `/usr/local/lib`.
297
125
***Linux:** Place the lib64 fnalibs in the `publish` directory, in a sub-directory called `netcoredeps`.
Copy file name to clipboardExpand all lines: docs/appendix/Appendix-A:-NativeAOT-on-PC.md
+1-7Lines changed: 1 addition & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Appendix E: NativeAOT on PC
1
+
# Appendix A: NativeAOT on PC
2
2
3
3
FNA now has support for [NativeAOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/), a new .NET toolchain which allows you to build your game into an ahead-of-time compiled native executable.
4
4
@@ -71,12 +71,6 @@ Finally, to actually link the fnalibs, follow these platform-specific instructio
71
71
* Grab the .lib files from SDL2, FNA3D, FAudio, and Theorafile and place them in your app's .csproj directory.
72
72
* Build the application.
73
73
* Copy the contents of `fnalibs/x64` into the generated output directory.
74
-
***MacOS:**
75
-
* Build SDL2 from source or install the SDL2 development package from a package manager, then use it to build the other libraries from source.
76
-
* Copy the resulting \*.dylib files from SDL2, FNA3D, FAudio, and Theorafile into `/usr/local/lib`.
77
-
* Build the application.
78
-
* Copy the contents of `fnalibs/osx` into the generated output directory.
79
-
* Finally, to ensure your application uses the correct search path for SDL2, use `install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib <my-app-name>`.
80
74
***Linux:**
81
75
* NOTE: For maximum compatibility, we recommend you build using a distro with a low glibc version, like Rocky Linux 8.
82
76
* Build SDL2 from source or install the SDL2 development package from a package manager, then use it to build FNA3D, FAudio, and Theorafile from source.
Copy file name to clipboardExpand all lines: docs/appendix/Appendix-B:-FNA-on-Consoles.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ For all console builds, you should make .NET 8 project files for your game - ins
10
10
11
11
While the runtimes require a console NDA, there are some things you can do to make your game more robust that just-so-happens to make console support easier, without access to any particular SDK. If you're familiar with consoles, none of these will be surprising:
12
12
13
+
### NativeAOT
14
+
15
+
All platforms use NativeAOT as the runtime. If you want a solid head-start, you should read Appendix A. Don't underestimate this step, especially if your game heavily depends on .NET's reflection features!
16
+
13
17
### Window Size Changes
14
18
Even if your window is not resizable, operating systems (including Windows!) may forcibly change the window size for a multitude of reasons, and so the graphics device will reset.
15
19
@@ -121,4 +125,4 @@ While there is no special code needed for Nintendo Switch support (100% of the p
121
125
122
126
FNA for PlayStation 4 and 5 is now in progress - the first draft of SDL-playstation was recently finished, with FNA3D support coming up next. FAudio and Theorafile are already working on PlayStation targets! For runtimes we are currently using NativeAOT, with Mono as our fallback plan.
123
127
124
-
If you are a licensee, please get in touch with [Ryan](mailto:[email protected]) for SDL access, then once you have access to that, let us know!
128
+
If you are a licensee, please get in touch with [Ryan](mailto:[email protected]) for SDL access, then once you have access to that, let us know!
Copy file name to clipboardExpand all lines: docs/appendix/Appendix-C:-FNA-on-Apple-Platforms.md
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Appendix A: FNA on iOS and tvOS
1
+
# Appendix C: FNA on Apple Platforms
2
2
3
-
As of FNA 24.03, FNA supports deploying to iOS and tvOS via the .NET SDK. FNA does not have special branches or configurations for each platform; the public master branch of FNA and the configuration you're already used to is exactly what is used to ship for these targets. The platform code is contained entirely in SDL.
3
+
FNA supports deploying to macOS/iOS/tvOS via the .NET SDK. FNA does not have special branches or configurations for each platform; the public master branch of FNA and the configuration you're already used to is exactly what is used to ship for these targets. The platform code is contained entirely in SDL.
4
4
5
5
## Getting Started
6
6
7
-
This is the basic guide to getting your game running in iOS/tvOS. Once these steps are followed, your game should be able to boot on real hardware.
7
+
This is the basic guide to getting your game running on macOS/iOS/tvOS. Once these steps are followed, your game should be able to boot on real hardware.
The process of building all the fnalibs is normally very tedious, and everybody _loves_ how good Xcode is, so as an alternative to building each project by hand, we have a pair of [build scripts](https://github.com/TheSpydog/fnalibs-ios-builder) that automatically download and build all of the fnalibs at once. If you would like to see the process in detail, take a look at the script sources - they're human-readable!
26
26
27
+
### Creating/Publishing a macOS Project
28
+
29
+
A macOS project is essentially the same as any other .NET Core build; the difference is in the publishing process:
30
+
31
+
`dotnet publish -r <osx-x64> -c Release --self-contained` will produce the executable package. Place the osx version of your fnalibs in the `publish` directory alongside your executable. Then use `install_name_tool -add_rpath @executable_path <your_app_executable_name>` to force the application to first look in the executable directory for the fnalibs, instead of `/usr/local/lib`.
32
+
33
+
For NativeAOT, the directions in Appendix A largely apply here, with these added steps:
34
+
35
+
* Build SDL3 from source or install the SDL3 development package from a package manager, then use it to build the other libraries from source.
36
+
* Copy the resulting \*.dylib files from SDL3, FNA3D, FAudio, and Theorafile into `/usr/local/lib`.
37
+
* Build the application.
38
+
* Copy the contents of `fnalibs/osx` into the generated output directory.
39
+
* Finally, to ensure your application uses the correct search path for SDL3, use `install_name_tool -change /usr/local/lib/libSDL3.0.dylib @rpath/libSDL3.0.dylib <my-app-name>`.
40
+
41
+
That about covers macOS - iOS/tvOS are a whole different story:
42
+
27
43
### Creating an iOS Project
28
44
29
45
Creating a .NET iOS project is almost identical to the process of [creating a desktop .NET project](https://github.com/FNA-XNA/FNA/wiki/1%3A-Setting-Up-FNA#chapter-5-creating-new-projects).
0 commit comments