Skip to content

Commit e582fb2

Browse files
committed
Remove Stadia docs, demote macOS to Appendix page, promote NativeAOT to page A
1 parent 6be8c50 commit e582fb2

5 files changed

+26
-203
lines changed

docs/3:-Distributing-FNA-Games.md

Lines changed: 1 addition & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ OS: glibc 2.28+, 64-bit only
2020
Graphics (Minimum): OpenGL 3.0+ support (2.1 with ARB extensions acceptable)
2121
Graphics (Recommended): Vulkan support
2222
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-
2823
Other: SDL_GameController devices fully supported
2924
```
3025

@@ -120,180 +115,13 @@ A good publicly-available example of this layout is the PC version of [I MAED A
120115

121116
***
122117

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:
131-
132-
* `kick.bin.osx`, `kick.bin.x86_64`, `monoconfig`, `monomachineconfig`
133-
* 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">
201-
<plist version="1.0">
202-
<dict>
203-
<key>CFBundleDevelopmentRegion</key>
204-
<string>en</string>
205-
<key>CFBundleExecutable</key>
206-
<string>EscapeGoat2</string>
207-
<key>CFBundleIconFile</key>
208-
<string>EscapeGoat2</string>
209-
<key>CFBundleIdentifier</key>
210-
<string>com.magicaltimebean.Bastille2</string>
211-
<key>CFBundleInfoDictionaryVersion</key>
212-
<string>6.0</string>
213-
<key>CFBundleName</key>
214-
<string>Escape Goat 2</string>
215-
<key>CFBundlePackageType</key>
216-
<string>APPL</string>
217-
<key>CFBundleShortVersionString</key>
218-
<string>1.0</string>
219-
<key>CFBundleSignature</key>
220-
<string>GOAT</string>
221-
<key>CFBundleVersion</key>
222-
<string>1</string>
223-
<key>LSApplicationCategoryType</key>
224-
<string>public.app-category.games</string>
225-
<key>LSMinimumSystemVersion</key>
226-
<string>10.9</string>
227-
<key>NSHumanReadableCopyright</key>
228-
<string>Copyright © 2014 MagicalTimeBean. All rights reserved.</string>
229-
<key>NSPrincipalClass</key>
230-
<string>NSApplication</string>
231-
<key>NSHighResolutionCapable</key>
232-
<string>True</string>
233-
</dict>
234-
</plist>
235-
```
236-
237-
With that, the final look of the bundle:
238-
239-
```
240-
flibitGame.app/
241-
Contents/
242-
Info.plist
243-
MacOS/
244-
flibitGame
245-
osx/
246-
Resources/
247-
vulkan/
248-
steam_appid.txt
249-
monoconfig
250-
monomachineconfig
251-
mscorlib.dll, System.dll, blah blah
252-
flibitGame.exe
253-
flibitGame.icns
254-
Content/
255-
etc...
256-
```
257-
258-
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">
265-
<plist version="1.0">
266-
<dict>
267-
<key>com.apple.security.app-sandbox</key>
268-
<true/>
269-
<key>com.apple.security.automation.apple-events</key>
270-
<true/>
271-
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
272-
<true/>
273-
<key>com.apple.security.cs.allow-jit</key>
274-
<true/>
275-
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
276-
<true/>
277-
<key>com.apple.security.cs.disable-executable-page-protection</key>
278-
<true/>
279-
<key>com.apple.security.cs.disable-library-validation</key>
280-
<true/>
281-
<key>com.apple.security.device.usb</key>
282-
<true/>
283-
</dict>
284-
</plist>
285-
```
286-
287-
When signing for Steam, the first key should be `false`, otherwise it won't be able to detect when Steam is running.
288-
289118
### .NET Core
290119

291120
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.
292121

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.
294123

295124
* **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`.
297125
* **Linux:** Place the lib64 fnalibs in the `publish` directory, in a sub-directory called `netcoredeps`.
298126

299127
#### Single-File Applications

docs/appendix/Appendix-E:-NativeAOT-on-PC.md renamed to docs/appendix/Appendix-A:-NativeAOT-on-PC.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Appendix E: NativeAOT on PC
1+
# Appendix A: NativeAOT on PC
22

33
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.
44

@@ -71,12 +71,6 @@ Finally, to actually link the fnalibs, follow these platform-specific instructio
7171
* Grab the .lib files from SDL2, FNA3D, FAudio, and Theorafile and place them in your app's .csproj directory.
7272
* Build the application.
7373
* 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>`.
8074
* **Linux:**
8175
* NOTE: For maximum compatibility, we recommend you build using a distro with a low glibc version, like Rocky Linux 8.
8276
* 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.

docs/appendix/Appendix-B:-FNA-on-Consoles.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ For all console builds, you should make .NET 8 project files for your game - ins
1010

1111
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:
1212

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+
1317
### Window Size Changes
1418
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.
1519

@@ -121,4 +125,4 @@ While there is no special code needed for Nintendo Switch support (100% of the p
121125

122126
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.
123127

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!

docs/appendix/Appendix-A:-FNA-on-iOS-and-tvOS.md renamed to docs/appendix/Appendix-C:-FNA-on-Apple-Platforms.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Appendix A: FNA on iOS and tvOS
1+
# Appendix C: FNA on Apple Platforms
22

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.
44

55
## Getting Started
66

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.
88

99
### Prerequisites
1010

@@ -24,6 +24,22 @@ sudo dotnet workload install tvos
2424

2525
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!
2626

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+
2743
### Creating an iOS Project
2844

2945
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).

docs/appendix/Appendix-C:-FNA-on-Google-Stadia.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)