| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
| 13 | 13 |
| 14 // Example usage from plugin code: | 14 // Example usage from plugin code: |
| 15 // | 15 // |
| 16 // PP_Resource context = device->Create(module, config, contextAttribList); | 16 // PP_Resource context = device->Create(module, config, contextAttribList); |
| 17 // CHECK(context); | 17 // CHECK(context); |
| 18 // | 18 // |
| 19 // // Present one frame. | 19 // // Present one frame. |
| 20 // CHECK(device->MakeCurrent(context)); | 20 // CHECK(device->MakeCurrent(context)); |
| 21 // glClear(GL_COLOR_BUFFER); | 21 // glClear(GL_COLOR_BUFFER); |
| 22 // CHECK(device->MakeCurrent(NULL)); | 22 // CHECK(device->MakeCurrent(NULL)); |
| 23 // CHECK(device->SwapBuffers(context)); | 23 // CHECK(device->SwapBuffers(context)); |
| 24 // | 24 // |
| 25 // // Shutdown. | 25 // // Shutdown. |
| 26 // core->ReleaseResource(context); | 26 // core->ReleaseResource(context); |
| 27 | 27 |
| 28 #define PPB_GRAPHICS_3D_DEV_INTERFACE "PPB_Graphics3D(Dev);0.2" | 28 #define PPB_GRAPHICS_3D_DEV_INTERFACE "PPB_Graphics3D(Dev);0.3" |
| 29 | 29 |
| 30 // These are the same error codes as used by EGL. | 30 // These are the same error codes as used by EGL. |
| 31 enum { | 31 enum { |
| 32 PP_GRAPHICS_3D_ERROR_SUCCESS = 0x3000, | 32 PP_GRAPHICS_3D_ERROR_SUCCESS = 0x3000, |
| 33 PP_GRAPHICS_3D_ERROR_NOT_INITIALIZED = 0x3001, | 33 PP_GRAPHICS_3D_ERROR_NOT_INITIALIZED = 0x3001, |
| 34 PP_GRAOHICS_3D_ERROR_BAD_CONTEXT = 0x3006, | 34 PP_GRAOHICS_3D_ERROR_BAD_CONTEXT = 0x3006, |
| 35 PP_GRAPHICS_3D_ERROR_BAD_PARAMETER = 0x300C, | 35 PP_GRAPHICS_3D_ERROR_BAD_PARAMETER = 0x300C, |
| 36 PP_GRAPHICS_3D_ERROR_CONTEXT_LOST = 0x300E | 36 PP_GRAPHICS_3D_ERROR_CONTEXT_LOST = 0x300E |
| 37 }; | 37 }; |
| 38 | 38 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // back-buffer to offscreen "front-buffer". | 95 // back-buffer to offscreen "front-buffer". |
| 96 PP_Bool (*SwapBuffers)(PP_Resource context); | 96 PP_Bool (*SwapBuffers)(PP_Resource context); |
| 97 | 97 |
| 98 // Returns the current error for this thread. This is not associated with a | 98 // Returns the current error for this thread. This is not associated with a |
| 99 // particular context. It is distinct from the GL error returned by | 99 // particular context. It is distinct from the GL error returned by |
| 100 // glGetError. | 100 // glGetError. |
| 101 uint32_t (*GetError)(); | 101 uint32_t (*GetError)(); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ | 104 #endif // PPAPI_C_DEV_PPB_GRAPHICS_3D_DEV_H_ |
| OLD | NEW |