Chromium Code Reviews| Index: native_client_sdk/src/libraries/ppapi_simple/ppapi_simple_main.h |
| diff --git a/native_client_sdk/src/libraries/ppapi_simple/ppapi_simple_main.h b/native_client_sdk/src/libraries/ppapi_simple/ppapi_simple_main.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..915106f63d9b8090eae85b05c569553183b5edf8 |
| --- /dev/null |
| +++ b/native_client_sdk/src/libraries/ppapi_simple/ppapi_simple_main.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ |
| +#define PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ |
| + |
| +#include "ppapi_simple/ppapi_event.h" |
| +#include "ppapi_simple/ppapi_simple.h" |
| + |
| +EXTERN_C_BEGIN |
| + |
| +typedef int (*PSMainFunc_t)(int argc, const char *argv[]); |
| + |
| +/** |
| + * PSCreateMain |
| + * |
| + * Constructs an instance SimpleInstance and configures it to use the |
| + * main and view callbacks passed in via the PSSimpleMainInit_t object. |
|
binji
2013/05/23 18:06:49
where is PSSimpleMainInit_t?
noelallen1
2013/05/23 22:01:24
Done.
|
| + */ |
| +void* PSCreateMain(PP_Instance inst, PSMainFunc_t func, const char **argv); |
| + |
| + |
| +/** |
| + * PPAPI_SIMPLE_MAIN |
| + * |
| + * Constructs an instance using PSCreateMain, and configures the 'main' and |
| + * 'view' callbacks. Either main and/or view may be NULL. To use: |
| + * |
| + * int my_main(int argc, const char* argv[]) { |
| + * ... some code ... |
| + * } |
| + * |
| + * PPAPI_SIMPLE_MAIN(my_main, ARGS...); |
| + * |
| + * NOTE: The library provides a simple 2D and 3D interface as well, however |
| + * those automatically manage the graphic contexts. To manage the graphics |
| + * yourself, use this interface and construct the graphics contexts and swap |
| + * screen buffers as appropriate. |
| + */ |
| + |
| + |
| +#define PPAPI_SIMPLE_MAIN(main, ...) \ |
| + PPAPI_USE_MAIN(PSCreateMain, main, ##__VA_ARGS__) |
| + |
| +EXTERN_C_END |
| + |
| +#endif /* PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ */ |
| + |