|
|
This is FNAPlatform, the platform abstraction layer and implementations for FNA.
|
|
|
|
|
|
The way FNA platforms are written is very simple:
|
|
|
|
|
|
1. Write implementations of the delegate types listed in FNAPlatform.cs
|
|
|
2. Assign the new functions in the FNAPlatform static constructor
|
|
|
|
|
|
Determining platform backends at runtime allows us to have portability across
|
|
|
all targets with a single binary, which is convenient for targeting multiple
|
|
|
platforms as well as multiple backends for each platform all simultaneously.
|
|
|
|
|
|
That said, if you are adding a new platform, it is extremely likely that you
|
|
|
will NOT be touching anything in FNA itself! The expectation is that 100% of
|
|
|
your work will end up in SDL2 and FNA3D. You _might_ add some OSVersion checks
|
|
|
to SDL2_FNAPlatform.cs, but that should be the only change in the managed code.
|
|
|
|
|
|
If for some reason you REALLY need a new FNAPlatform, the new platforms will add
|
|
|
code exclusively to this folder. Some interfaces may need to change for new
|
|
|
platforms, but changing the interface should be as simple as making the
|
|
|
modifications at the interface layer and fixing the code in both the XNA
|
|
|
reimplementation code as well as each platform backend file that depends on
|
|
|
those interfaces, all of which should throw errors at compile time right away,
|
|
|
regardless of your current target platform.
|
|
|
|
|
|
When submitting new platforms, please test ALL platforms and ALL backends!
|
|
|
|