Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (17 sloc) 2.85 KB

SampleFNA

A browser port of the MonoGame Platformer2D sample, using FNA (an open-source implementation of the XNA libraries), SDL2, Emscripten, and JSIL.

Building

  • You'll need to have JSIL checked out in a folder next to this one, so that SampleFNA\..\JSIL is valid.
  • You also need to clone the FNA fork next to this repository, so that SampleFNA\..\FNA is valid. In the future we hope to merge this support into trunk FNA (and add it as a submodule to this sample).
  • Building the project in Visual Studio will automatically invoke JSILc to generate the appropriate JavaScript files. Check the build output window to see the results. (You can also run the buildJSIL.bat file directly.)
  • You will need the latest MonoGame SDK installed if you want to compile the sample's content into the XNB files used by the sample. Once you have it installed, double-click the Platformer2D\Content\Platformer2d.mgcb file to open the content build tool and Build to create the necessary content files. This only needs to be done once.
  • For Song playback to work, you'll need to convert Music.wma into an ogg vorbis file called Music.ogg, next to the Music.xnb file created by the content builder above. Sadly, the content builder cannot do this for us. (JSILc may acquire the ability to do this in the future.)
  • To build SDL2.js install the latest Emscripten SDK and run buildSDL.bat.
  • To build soft_oal.js install the latest Emscripten SDK and run buildOpenAL.bat
    • For Song playback to work you will need to hand-edit soft_oal.js by searching for var AL={contexts: and replacing it with var AL=Module["OpenAL"]={contexts:. This is a workaround for an open Emscripten issue.

Running

Open index.html in a browser. However, this will only work when loaded from a web server, because modern web browsers deny access to resources over the file:// protocol.

Authors & Copyright