Difference between revisions of "Engine:FNA"
m (GetGUIDEXT Link) |
(FNA3D changes) |
||
(16 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{Infobox engine | {{Infobox engine | ||
− | |||
|cover=Engine - FNA - logo.svg | |cover=Engine - FNA - logo.svg | ||
|developer=Ethan Lee | |developer=Ethan Lee | ||
− | |website= | + | |website=https://fna-xna.github.io |
− | | | + | |first release=December 21, 2015 |
+ | |predecessor=XNA | ||
+ | |listgames=false | ||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
'''FNA''' is an open source reimplementation of the Microsoft XNA Framework, specifically the 4.0 Refresh revision. It started as a branch of MonoGame called "MonoGame-SDL2". | '''FNA''' is an open source reimplementation of the Microsoft XNA Framework, specifically the 4.0 Refresh revision. It started as a branch of MonoGame called "MonoGame-SDL2". | ||
The goal of the project is to recreate a fast, portable, and accurate XNA4 runtime library that prevents the need for code/content changes on the part of the XNA game developer. The currently supported platforms include Windows, Mac OS X and GNU/Linux, with further platform support including those supported by SDL2. | The goal of the project is to recreate a fast, portable, and accurate XNA4 runtime library that prevents the need for code/content changes on the part of the XNA game developer. The currently supported platforms include Windows, Mac OS X and GNU/Linux, with further platform support including those supported by SDL2. | ||
+ | |||
+ | ==Launch Options== | ||
+ | As of FNA 20.01, a handful of command line arguments are supported automatically by games using FNA: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameter !! Description | ||
+ | |- | ||
+ | |/enablehighdpi:1 | ||
+ | |On macOS and Wayland, attempt to use a Retina-capable window | ||
+ | |- | ||
+ | |/mojoshaderprofile:... | ||
+ | |Force a specific shader profile. Available options: glsl120, glspirv | ||
+ | |- | ||
+ | |/backbufferscalenearest:1 | ||
+ | |When scaling the game resolution, use a nearest-neighbor filter. Useful for pixel art games. | ||
+ | |- | ||
+ | |/usescancodes:1 | ||
+ | |Use scancodes for keyboard input, ignoring the user's keyboard layout | ||
+ | |- | ||
+ | |/disablelateswaptear:1 | ||
+ | |Do not use FIFO_RELAXED or EXT_swap_control_tear extension, disables adaptive VSync | ||
+ | |- | ||
+ | |/glprofile:... | ||
+ | |Force a specific OpenGL profile. Available options: es3, core, compatibility | ||
+ | |- | ||
+ | |/gldevice:... | ||
+ | |Force a specific renderer. Available options: OpenGL, Vulkan, D3D11, Metal | ||
+ | |- | ||
+ | |/angle:1 | ||
+ | |Attempt to use OpenGL ES 3.0 via ANGLE. Useful for rendering with D3D11, Vulkan, etc. | ||
+ | |} | ||
+ | |||
+ | More detailed information about these options can be found on the [https://github.com/FNA-XNA/FNA/wiki/7:-FNA-Environment-Variables FNA Developer Wiki]. | ||
==Joysticks== | ==Joysticks== | ||
Line 21: | Line 51: | ||
===Automatic Configuration: SDL_GameController=== | ===Automatic Configuration: SDL_GameController=== | ||
− | Since FNA uses SDL2 as its base library, we also get the benefit of SDL_GameController, a new subsystem added by Alfred Reynolds at Valve. This takes configurations for known controllers and automatically configures them for the virtual 360 controller, so if your controller is recognized, manual configuration is not necessary. If you run an FNA title through Steam, your controller will automatically be configured using the Big Picture Mode configuration. | + | Since FNA uses SDL2 as its base library, we also get the benefit of SDL_GameController, a new subsystem added by Alfred Reynolds at Valve. This takes configurations for known controllers and automatically configures them for the virtual 360 controller, so if your controller is recognized, manual configuration is not necessary. If you run an FNA title through Steam, your controller will automatically be configured using the Big Picture Mode configuration. Additionally, FNA reads from a gamecontroller.txt file for configurations, when it's found in the game's base directory. You can find a community-sourced database [https://github.com/gabomdq/SDL_GameControllerDB/ here]. |
===About GUIDs=== | ===About GUIDs=== | ||
− | In addition to expanded configuration support, FNA provides the [https://github.com/ | + | In addition to expanded configuration support, FNA provides the [https://github.com/FNA-XNA/FNA/wiki/5:-FNA-Extensions#getguidext GetGUIDEXT] extension that allows XNA devs to pull in a trimmed/standardized GUID string to determine the controller hardware and react accordingly. [[TowerFall Ascension]] uses this for button icon support, for example. |
Consider this GUID from the PlayStation 4 controller: | Consider this GUID from the PlayStation 4 controller: | ||
− | // | + | // This is the string reported by SDL2's SDL_JoystickGetGUIDString: |
// https://wiki.libsdl.org/SDL_JoystickGetGUIDString | // https://wiki.libsdl.org/SDL_JoystickGetGUIDString | ||
− | + | // Note characters 9-12 and 17-20. | |
− | + | 030000004c050000c405000011010000 | |
− | 030000004c050000c405000011010000 | + | |
− | + | // This is the GUID string returned by FNA. Get it? | |
− | + | 4c05c405 | |
For XInput controllers on Windows, the GUID string is simply 'xinput'. | For XInput controllers on Windows, the GUID string is simply 'xinput'. | ||
===DualShock 4 Light Bar Support=== | ===DualShock 4 Light Bar Support=== | ||
− | + | {{ii}} Currently only supported on Linux, with kernel 3.15 and higher or SteamOS version 137 and higher. | |
− | + | FNA supports the DualShock 4 light bar, although it requires game developers to make use of the [https://github.com/FNA-XNA/FNA/wiki/5:-FNA-Extensions#setlightbarext SetLightBarEXT] extension to set the color of the light bar by way of adjusting the brightness of the RGB LEDs. Users also needs to allow write permission to brightness files per the below instructions before the game can make use of the light bar. | |
− | + | {{Fixbox|description=For users: Enable light bar support for FNA games that supports it|fix= | |
+ | # Open a terminal window and obtain root access using e.g. <code>su root</code> or appropriate alternative. | ||
+ | # Allow write permission to the brightness files for the red/blue/green LEDs via /sys/class/leds/. For example: | ||
cd /sys/class/leds/ | cd /sys/class/leds/ | ||
Line 50: | Line 82: | ||
chmod 777 0003:054C:05C4.0021:blue/brightness | chmod 777 0003:054C:05C4.0021:blue/brightness | ||
− | + | '''Notes''' | |
+ | {{ii}} The folder noted above can change per instance, but the constant value is 054C:05C4, the hardware ID for the DualShock 4. For the DualShock 4 Slim, the constant value is 054C:09CC. | ||
+ | }} | ||
+ | |||
+ | {{Infobox engine/ask}} | ||
+ | |||
+ | {{References}} |
Revision as of 16:09, 1 September 2020
Developers | |
---|---|
Ethan Lee | |
Website | |
https://fna-xna.github.io | |
First release date | |
December 21, 2015 | |
Predecessor | |
XNA |
FNA is an open source reimplementation of the Microsoft XNA Framework, specifically the 4.0 Refresh revision. It started as a branch of MonoGame called "MonoGame-SDL2".
The goal of the project is to recreate a fast, portable, and accurate XNA4 runtime library that prevents the need for code/content changes on the part of the XNA game developer. The currently supported platforms include Windows, Mac OS X and GNU/Linux, with further platform support including those supported by SDL2.
Launch Options
As of FNA 20.01, a handful of command line arguments are supported automatically by games using FNA:
Parameter | Description |
---|---|
/enablehighdpi:1 | On macOS and Wayland, attempt to use a Retina-capable window |
/mojoshaderprofile:... | Force a specific shader profile. Available options: glsl120, glspirv |
/backbufferscalenearest:1 | When scaling the game resolution, use a nearest-neighbor filter. Useful for pixel art games. |
/usescancodes:1 | Use scancodes for keyboard input, ignoring the user's keyboard layout |
/disablelateswaptear:1 | Do not use FIFO_RELAXED or EXT_swap_control_tear extension, disables adaptive VSync |
/glprofile:... | Force a specific OpenGL profile. Available options: es3, core, compatibility |
/gldevice:... | Force a specific renderer. Available options: OpenGL, Vulkan, D3D11, Metal |
/angle:1 | Attempt to use OpenGL ES 3.0 via ANGLE. Useful for rendering with D3D11, Vulkan, etc. |
More detailed information about these options can be found on the FNA Developer Wiki.
Joysticks
About XNA Joystick Support
XNA, being a Microsoft technology, centered its controller input around the Xbox 360 Controller. Because of this, the XNA API is not cleanly compatible with custom controllers, including the Xbox 360 Controller when not being read by XInput. However, a config format was developed to allow binding of joystick input values to a virtual 360 controller, which then gets read by XNA games.
Automatic Configuration: SDL_GameController
Since FNA uses SDL2 as its base library, we also get the benefit of SDL_GameController, a new subsystem added by Alfred Reynolds at Valve. This takes configurations for known controllers and automatically configures them for the virtual 360 controller, so if your controller is recognized, manual configuration is not necessary. If you run an FNA title through Steam, your controller will automatically be configured using the Big Picture Mode configuration. Additionally, FNA reads from a gamecontroller.txt file for configurations, when it's found in the game's base directory. You can find a community-sourced database here.
About GUIDs
In addition to expanded configuration support, FNA provides the GetGUIDEXT extension that allows XNA devs to pull in a trimmed/standardized GUID string to determine the controller hardware and react accordingly. TowerFall Ascension uses this for button icon support, for example.
Consider this GUID from the PlayStation 4 controller:
// This is the string reported by SDL2's SDL_JoystickGetGUIDString: // https://wiki.libsdl.org/SDL_JoystickGetGUIDString // Note characters 9-12 and 17-20. 030000004c050000c405000011010000
// This is the GUID string returned by FNA. Get it? 4c05c405
For XInput controllers on Windows, the GUID string is simply 'xinput'.
DualShock 4 Light Bar Support
- Currently only supported on Linux, with kernel 3.15 and higher or SteamOS version 137 and higher.
FNA supports the DualShock 4 light bar, although it requires game developers to make use of the SetLightBarEXT extension to set the color of the light bar by way of adjusting the brightness of the RGB LEDs. Users also needs to allow write permission to brightness files per the below instructions before the game can make use of the light bar.
For users: Enable light bar support for FNA games that supports it |
---|
cd /sys/class/leds/ chmod 777 0003:054C:05C4.0021:red/brightness chmod 777 0003:054C:05C4.0021:green/brightness chmod 777 0003:054C:05C4.0021:blue/brightness Notes
|