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 GPU_PGL_PGL_H | 5 #ifndef GPU_PGL_PGL_H |
6 #define GPU_PGL_PGL_H | 6 #define GPU_PGL_PGL_H |
7 | 7 |
8 #include "npapi.h" | 8 #include "npapi.h" |
9 #include "npapi_extensions.h" | 9 #include "npapi_extensions.h" |
10 | 10 |
| 11 #define PGL_TRUE 1 |
| 12 #define PGL_FALSE 0 |
| 13 |
11 #ifdef __cplusplus | 14 #ifdef __cplusplus |
12 extern "C" { | 15 extern "C" { |
13 #endif | 16 #endif |
14 | 17 |
15 typedef void* PGLContext; | 18 typedef void* PGLContext; |
16 typedef bool PGLBoolean; | 19 typedef unsigned int PGLBoolean; |
| 20 typedef int32 PGLInt; |
| 21 |
| 22 // These are the same error codes as used by EGL. |
| 23 enum { |
| 24 PGL_SUCCESS = 0x3000, |
| 25 PGL_NOT_INITIALIZED = 0x3001, |
| 26 PGL_BAD_CONTEXT = 0x3006, |
| 27 PGL_BAD_PARAMETER = 0x300C, |
| 28 PGL_CONTEXT_LOST = 0x300E |
| 29 }; |
17 | 30 |
18 // Initialize the PGL library. This must have completed before any other PGL | 31 // Initialize the PGL library. This must have completed before any other PGL |
19 // functions are invoked. | 32 // functions are invoked. |
20 PGLBoolean pglInitialize(); | 33 PGLBoolean pglInitialize(); |
21 | 34 |
22 // Terminate the PGL library. This must be called after any other PGL functions | 35 // Terminate the PGL library. This must be called after any other PGL functions |
23 // have completed. | 36 // have completed. |
24 PGLBoolean pglTerminate(); | 37 PGLBoolean pglTerminate(); |
25 | 38 |
26 // Create A PGL context from a Pepper 3D device context. | 39 // Create A PGL context from a Pepper 3D device context. |
27 PGLContext pglCreateContext(NPP npp, | 40 PGLContext pglCreateContext(NPP npp, |
28 NPDevice* device, | 41 NPDevice* device, |
29 NPDeviceContext3D* device_context); | 42 NPDeviceContext3D* device_context); |
30 | 43 |
31 // Set the current PGL context for the calling thread. | 44 // Set the current PGL context for the calling thread. |
32 PGLBoolean pglMakeCurrent(PGLContext pgl_context); | 45 PGLBoolean pglMakeCurrent(PGLContext pgl_context); |
33 | 46 |
34 // Get the calling thread's current PGL context. | 47 // Get the calling thread's current PGL context. |
35 PGLContext pglGetCurrentContext(void); | 48 PGLContext pglGetCurrentContext(void); |
36 | 49 |
37 // Display everything that has been rendered since the last call. | 50 // Display everything that has been rendered since the last call. |
38 PGLBoolean pglSwapBuffers(void); | 51 PGLBoolean pglSwapBuffers(void); |
39 | 52 |
40 // Destroy the given PGL context. | 53 // Destroy the given PGL context. |
41 PGLBoolean pglDestroyContext(PGLContext pgl_context); | 54 PGLBoolean pglDestroyContext(PGLContext pgl_context); |
42 | 55 |
| 56 // Return the current PGL error. |
| 57 PGLInt pglGetError(); |
| 58 |
43 #ifdef __cplusplus | 59 #ifdef __cplusplus |
44 } // extern "C" | 60 } // extern "C" |
45 #endif | 61 #endif |
46 | 62 |
47 #endif // GPU_PGL_PGL_H | 63 #endif // GPU_PGL_PGL_H |
OLD | NEW |