Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ | |
| 6 #define PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ | |
| 7 | |
| 8 #include "ppapi_simple/ppapi_event.h" | |
| 9 #include "ppapi_simple/ppapi_simple.h" | |
| 10 | |
| 11 EXTERN_C_BEGIN | |
| 12 | |
| 13 typedef int (*PSMainFunc_t)(int argc, const char *argv[]); | |
| 14 | |
| 15 /** | |
| 16 * PSCreateMain | |
| 17 * | |
| 18 * Constructs an instance SimpleInstance and configures it to use the | |
| 19 * 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.
| |
| 20 */ | |
| 21 void* PSCreateMain(PP_Instance inst, PSMainFunc_t func, const char **argv); | |
| 22 | |
| 23 | |
| 24 /** | |
| 25 * PPAPI_SIMPLE_MAIN | |
| 26 * | |
| 27 * Constructs an instance using PSCreateMain, and configures the 'main' and | |
| 28 * 'view' callbacks. Either main and/or view may be NULL. To use: | |
| 29 * | |
| 30 * int my_main(int argc, const char* argv[]) { | |
| 31 * ... some code ... | |
| 32 * } | |
| 33 * | |
| 34 * PPAPI_SIMPLE_MAIN(my_main, ARGS...); | |
| 35 * | |
| 36 * NOTE: The library provides a simple 2D and 3D interface as well, however | |
| 37 * those automatically manage the graphic contexts. To manage the graphics | |
| 38 * yourself, use this interface and construct the graphics contexts and swap | |
| 39 * screen buffers as appropriate. | |
| 40 */ | |
| 41 | |
| 42 | |
| 43 #define PPAPI_SIMPLE_MAIN(main, ...) \ | |
| 44 PPAPI_USE_MAIN(PSCreateMain, main, ##__VA_ARGS__) | |
| 45 | |
| 46 EXTERN_C_END | |
| 47 | |
| 48 #endif /* PPAPI_SIMPLE_PPAPI_SIMPLE_MAIN_H_ */ | |
| 49 | |
| OLD | NEW |