| 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_CPP_DEV_GRAPHICS_3D_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ |
| 6 #define PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ | 6 #define PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" | 8 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" |
| 9 #include "ppapi/c/dev/ppb_opengles_dev.h" | 9 #include "ppapi/c/dev/ppb_opengles_dev.h" |
| 10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
| 11 #include "ppapi/cpp/resource.h" | 11 #include "ppapi/cpp/resource.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 class Graphics3D_Dev : public Resource { | 15 class Graphics3D_Dev : public Resource { |
| 16 public: | 16 public: |
| 17 static bool GetConfigs(int32_t* configs, int32_t config_size, | 17 static bool GetConfigs(int32_t* configs, int32_t config_size, |
| 18 int32_t* num_config); | 18 int32_t* num_config); |
| 19 | 19 |
| 20 static bool ChooseConfig(const int32_t* attrib_list, int32_t* configs, | 20 static bool ChooseConfig(const int32_t* attrib_list, int32_t* configs, |
| 21 int32_t config_size, int32_t* num_config); | 21 int32_t config_size, int32_t* num_config); |
| 22 | 22 |
| 23 static bool GetConfigAttrib(int32_t config, int32_t attribute, | 23 static bool GetConfigAttrib(int32_t config, int32_t attribute, |
| 24 int32_t* value); | 24 int32_t* value); |
| 25 | 25 |
| 26 static const char* QueryString(int32_t name); | 26 static const char* QueryString(int32_t name); |
| 27 | 27 |
| 28 static void* GetProcAddress(const char* name); | 28 static void* GetProcAddress(const char* name); |
| 29 | 29 |
| 30 static bool ResetCurrent(); | |
| 31 static Graphics3D_Dev GetCurrentContext(); | |
| 32 static uint32_t GetError(); | 30 static uint32_t GetError(); |
| 33 static const PPB_OpenGLES_Dev* GetImplementation(); | 31 static const PPB_OpenGLES2_Dev* GetImplementation(); |
| 34 | 32 |
| 35 // Creates an is_null() Graphics3D object. | 33 // Creates an is_null() Graphics3D object. |
| 36 Graphics3D_Dev() {} | 34 Graphics3D_Dev() {} |
| 37 | 35 |
| 38 Graphics3D_Dev(const Instance& instance, | 36 Graphics3D_Dev(const Instance& instance, |
| 39 int32_t config, | 37 int32_t config, |
| 40 int32_t share_context, | 38 int32_t share_context, |
| 41 const int32_t* attrib_list); | 39 const int32_t* attrib_list); |
| 42 | 40 |
| 43 bool MakeCurrent() const; | |
| 44 bool SwapBuffers() const; | 41 bool SwapBuffers() const; |
| 45 | 42 |
| 46 protected: | 43 protected: |
| 47 explicit Graphics3D_Dev(PP_Resource resource_id) : Resource(resource_id) {} | 44 explicit Graphics3D_Dev(PP_Resource resource_id) : Resource(resource_id) {} |
| 48 static Graphics3D_Dev FromResource(PP_Resource resource_id); | 45 static Graphics3D_Dev FromResource(PP_Resource resource_id); |
| 49 }; | 46 }; |
| 50 | 47 |
| 51 } // namespace pp | 48 } // namespace pp |
| 52 | 49 |
| 53 #endif // PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ | 50 #endif // PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ |
| 54 | 51 |
| OLD | NEW |