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