README-nacl.txt
author Gabriel Jacobo <gabomdq@gmail.com>
Sun, 08 Jun 2014 18:18:13 -0300
changeset 8851 a7cfe554d337
parent 8833 ae720d61d14d
child 8852 bb99ec3b21d8
permissions -rw-r--r--
Fixes audio for Native Client, and other fixes...

- SDL_NaClMount, SDL_NaClUmount
- Default mounting of https at / in SDL's main function
- More documentation in README-nacl.txt
     1 ================================================================================
     2 Simple DirectMedia Layer for Native Client
     3 ================================================================================
     4 
     5 Requirements: 
     6     
     7     * Native Client SDK (https://developer.chrome.com/native-client), 
     8       (tested with Pepper version 33 or higher).
     9 
    10 The SDL backend for Chrome's Native Client has been tested only with the PNaCl
    11 toolchain, which generates binaries designed to run on ARM and x86_32/64 
    12 platforms. This does not mean it won't work with the other toolchains!
    13 
    14 ================================================================================
    15 Building SDL for NaCl
    16 ================================================================================
    17 
    18 Set up the right environment variables (see naclbuild.sh), then configure SDL with:
    19 
    20     configure --host=pnacl --prefix some/install/destination
    21     
    22 Then "make". 
    23 
    24 As an example of how to create a deployable app a Makefile project is provided 
    25 in test/nacl/Makefile, which includes some monkey patching of the common.mk file 
    26 provided by NaCl, without which linking properly to SDL won't work (the search 
    27 path can't be modified externally, so the linker won't find SDL's binaries unless 
    28 you dump them into the SDK path, which is inconvenient).
    29 Also provided in test/nacl is the required support file, such as index.html, 
    30 manifest.json, etc.
    31 
    32 
    33 ================================================================================
    34 Running tests
    35 ================================================================================
    36 
    37 Due to the nature of NaCl programs, building and running SDL tests is not as
    38 straightforward as one would hope. The script naclbuild.sh in build-scripts 
    39 automates the process and should serve as a guide for users of SDL trying to build 
    40 their own applications.
    41 
    42 Basic usage:
    43     
    44     ./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
    45     
    46 This will build testgles2.c by default.
    47 
    48 If you want to build a different test, for example testrendercopyex.c:
    49     
    50     SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
    51     
    52 Once the build finishes, you have to serve the contents with a web server (the
    53 script will give you instructions on how to do that with Python).
    54 
    55 ================================================================================
    56 RWOps and nacl_io
    57 ================================================================================
    58 
    59 SDL_RWops work transparently with nacl_io. Two functions are provided to control
    60 mount points:
    61     
    62     
    63     For convenience, SDL will by default
    64 mount an httpfs tree at / before calling the app's main function. Such setting
    65 can be overriden by calling SDL_NaCl
    66 
    67 For more information on how nacl_io and mount points work, see:
    68     
    69     https://developer.chrome.com/native-client/devguide/coding/nacl_io
    70 
    71 ================================================================================
    72 TODO - Known Issues
    73 ================================================================================
    74 * Testing of all systems with a real application (something other than SDL's tests)
    75