emscripten Humble Cloud interface
Edward Rudd
2015-07-09 232d457188ce7efce8f32670473a4524276b488b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __HUMBLE_CLOUD_H__
#define __HUMBLE_CLOUD_H__
 
#include <emscripten/emscripten.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
    int humble_init();
 
    /**
     * Trigger a FS.syncfs call on the emscripten Filesystem
     */
    void humble_syncfs();
 
    /**
     * This method is 100% compatible to emscripten_async_wget_data.
     * Except that it can cache the fetched files into IndexedDB and it has 2 extension points
     *   one to map the URL/path (e.g. to handle pre-signed GETs against CDNs)
     *   another to map the URL path to a cache KEY. (e.g. if using relative allow it to be prefixed by something else
     */
    void humble_fetch_asset_data(const char* url, void *arg, em_async_wget_onload_func onload, em_arg_callback_func onerror);
 
    /**
     * Gets the allowable player size of the humble player.  Use this to restrict the size of the game in windowed mode.
     * returns 1 if the restriction should be enforced.. 0 otherwise
     */
    int humble_get_player_size(int *width, int *height);
 
    /**
     * Called to let the humble player know the demo has ended.
     */
    void humble_demo_ended();
 
#ifdef __cplusplus
};
#endif
 
#endif // __HUMBLE_CLOUD_H__