OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From ppb_graphics_3d.idl modified Thu Mar 28 10:12:11 2013. */ | 6 /* From ppb_graphics_3d.idl modified Fri Aug 30 08:36:16 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_GRAPHICS_3D_H_ | 8 #ifndef PPAPI_C_PPB_GRAPHICS_3D_H_ |
9 #define PPAPI_C_PPB_GRAPHICS_3D_H_ | 9 #define PPAPI_C_PPB_GRAPHICS_3D_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
(...skipping 18 matching lines...) Expand all Loading... |
35 /** | 35 /** |
36 * <code>PPB_Graphics3D</code> defines the interface for a 3D graphics context. | 36 * <code>PPB_Graphics3D</code> defines the interface for a 3D graphics context. |
37 * <strong>Example usage from plugin code:</strong> | 37 * <strong>Example usage from plugin code:</strong> |
38 * | 38 * |
39 * <strong>Setup:</strong> | 39 * <strong>Setup:</strong> |
40 * @code | 40 * @code |
41 * PP_Resource context; | 41 * PP_Resource context; |
42 * int32_t attribs[] = {PP_GRAPHICS3DATTRIB_WIDTH, 800, | 42 * int32_t attribs[] = {PP_GRAPHICS3DATTRIB_WIDTH, 800, |
43 * PP_GRAPHICS3DATTRIB_HEIGHT, 800, | 43 * PP_GRAPHICS3DATTRIB_HEIGHT, 800, |
44 * PP_GRAPHICS3DATTRIB_NONE}; | 44 * PP_GRAPHICS3DATTRIB_NONE}; |
45 * context = g3d->Create(instance, attribs, &context); | 45 * context = g3d->Create(instance, 0, attribs); |
46 * inst->BindGraphics(instance, context); | 46 * inst->BindGraphics(instance, context); |
47 * @endcode | 47 * @endcode |
48 * | 48 * |
49 * <strong>Present one frame:</strong> | 49 * <strong>Present one frame:</strong> |
50 * @code | 50 * @code |
51 * gles2->Clear(context, GL_COLOR_BUFFER); | 51 * PP_CompletionCallback callback = { |
52 * g3d->SwapBuffers(context); | 52 * DidFinishSwappingBuffers, 0, PP_COMPLETIONCALLBACK_FLAG_NONE, |
| 53 * }; |
| 54 * gles2->Clear(context, GL_COLOR_BUFFER_BIT); |
| 55 * g3d->SwapBuffers(context, callback); |
53 * @endcode | 56 * @endcode |
54 * | 57 * |
55 * <strong>Shutdown:</strong> | 58 * <strong>Shutdown:</strong> |
56 * @code | 59 * @code |
57 * core->ReleaseResource(context); | 60 * core->ReleaseResource(context); |
58 * @endcode | 61 * @endcode |
59 */ | 62 */ |
60 struct PPB_Graphics3D_1_0 { | 63 struct PPB_Graphics3D_1_0 { |
61 /** | 64 /** |
62 * GetAttribMaxValue() retrieves the maximum supported value for the | 65 * GetAttribMaxValue() retrieves the maximum supported value for the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 * @param[in] instance The module instance. | 98 * @param[in] instance The module instance. |
96 * | 99 * |
97 * @param[in] share_context The 3D context with which the created context | 100 * @param[in] share_context The 3D context with which the created context |
98 * would share resources. If <code>share_context</code> is not 0, then all | 101 * would share resources. If <code>share_context</code> is not 0, then all |
99 * shareable data, as defined by the client API (note that for OpenGL and | 102 * shareable data, as defined by the client API (note that for OpenGL and |
100 * OpenGL ES, shareable data excludes texture objects named 0) will be shared | 103 * OpenGL ES, shareable data excludes texture objects named 0) will be shared |
101 * by <code>share_context<code>, all other contexts <code>share_context</code> | 104 * by <code>share_context<code>, all other contexts <code>share_context</code> |
102 * already shares with, and the newly created context. An arbitrary number of | 105 * already shares with, and the newly created context. An arbitrary number of |
103 * <code>PPB_Graphics3D</code> can share data in this fashion. | 106 * <code>PPB_Graphics3D</code> can share data in this fashion. |
104 * | 107 * |
105 * @param[out] attrib_list specifies a list of attributes for the context. | 108 * @param[in] attrib_list specifies a list of attributes for the context. |
106 * It is a list of attribute name-value pairs in which each attribute is | 109 * It is a list of attribute name-value pairs in which each attribute is |
107 * immediately followed by the corresponding desired value. The list is | 110 * immediately followed by the corresponding desired value. The list is |
108 * terminated with <code>PP_GRAPHICS3DATTRIB_NONE</code>. | 111 * terminated with <code>PP_GRAPHICS3DATTRIB_NONE</code>. |
109 * The <code>attrib_list<code> may be 0 or empty (first attribute is | 112 * The <code>attrib_list<code> may be 0 or empty (first attribute is |
110 * <code>PP_GRAPHICS3DATTRIB_NONE</code>). If an attribute is not | 113 * <code>PP_GRAPHICS3DATTRIB_NONE</code>). If an attribute is not |
111 * specified in <code>attrib_list</code>, then the default value is used | 114 * specified in <code>attrib_list</code>, then the default value is used |
112 * (it is said to be specified implicitly). | 115 * (it is said to be specified implicitly). |
113 * Attributes for the context are chosen according to an attribute-specific | 116 * Attributes for the context are chosen according to an attribute-specific |
114 * criteria. Attributes can be classified into two categories: | 117 * criteria. Attributes can be classified into two categories: |
115 * - AtLeast: The attribute value in the returned context meets or exceeds | 118 * - AtLeast: The attribute value in the returned context meets or exceeds |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 struct PP_CompletionCallback callback); | 289 struct PP_CompletionCallback callback); |
287 }; | 290 }; |
288 | 291 |
289 typedef struct PPB_Graphics3D_1_0 PPB_Graphics3D; | 292 typedef struct PPB_Graphics3D_1_0 PPB_Graphics3D; |
290 /** | 293 /** |
291 * @} | 294 * @} |
292 */ | 295 */ |
293 | 296 |
294 #endif /* PPAPI_C_PPB_GRAPHICS_3D_H_ */ | 297 #endif /* PPAPI_C_PPB_GRAPHICS_3D_H_ */ |
295 | 298 |
OLD | NEW |