README-nacl.txt
changeset 8877 0d691f3734ac
parent 8873 77ffe680093f
equal deleted inserted replaced
8876:60edb019f0fe 8877:0d691f3734ac
    58 
    58 
    59 ================================================================================
    59 ================================================================================
    60 RWops and nacl_io
    60 RWops and nacl_io
    61 ================================================================================
    61 ================================================================================
    62 
    62 
    63 SDL_RWops work transparently with nacl_io. Two functions are provided to control
    63 SDL_RWops work transparently with nacl_io. Two functions control the mount points:
    64 mount points:
       
    65     
    64     
    66     int SDL_NaClMount(const char* source, const char* target, 
    65     int mount(const char* source, const char* target, 
    67                       const char* filesystemtype, 
    66                       const char* filesystemtype, 
    68                       unsigned long mountflags, const void *data);
    67                       unsigned long mountflags, const void *data);
    69     int SDL_NaClUmount(const char *target);
    68     int umount(const char *target);
    70     
    69     
    71     For convenience, SDL will by default mount an httpfs tree at / before calling 
    70     For convenience, SDL will by default mount an httpfs tree at / before calling 
    72 the app's main function. Such setting can be overridden by calling:
    71 the app's main function. Such setting can be overridden by calling:
    73     
    72     
    74     SDL_NaClUmount("/");
    73     umount("/");
    75 
    74 
    76 And then mounting a different filesystem at /
    75 And then mounting a different filesystem at /
    77 
    76 
    78 It's important to consider that the asynchronous nature of file operations on a
    77 It's important to consider that the asynchronous nature of file operations on a
    79 browser is hidden from the application, effectively providing the developer with
    78 browser is hidden from the application, effectively providing the developer with
    83 connections are involved.
    82 connections are involved.
    84 
    83 
    85 For more information on how nacl_io and mount points work, see:
    84 For more information on how nacl_io and mount points work, see:
    86     
    85     
    87     https://developer.chrome.com/native-client/devguide/coding/nacl_io
    86     https://developer.chrome.com/native-client/devguide/coding/nacl_io
       
    87     https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
       
    88 
       
    89 To be able to save into the directory "/save/" (like backup of game) :
       
    90 
       
    91     mount("", "/save", "html5fs", 0, "type=PERSISTENT");
       
    92 
       
    93 And add to manifest.json :
       
    94 
       
    95   "permissions": [
       
    96      "unlimitedStorage"
       
    97   ]
    88 
    98 
    89 ================================================================================
    99 ================================================================================
    90 TODO - Known Issues
   100 TODO - Known Issues
    91 ================================================================================
   101 ================================================================================
    92 * Testing of all systems with a real application (something other than SDL's tests)
   102 * Testing of all systems with a real application (something other than SDL's tests)