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 3 // found in the LICENSE file. 4 5 // These functions emulate GLES2 over command buffers. 6 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 9 10 #include "gpu/command_buffer/client/gles2_c_lib_export.h" 11 #include "gpu/command_buffer/client/gles2_interface.h" 12 13 namespace gles2 { 14 15 typedef void (*GLES2FunctionPointer)(void); 16 17 struct NameToFunc { 18 const char* name; 19 gles2::GLES2FunctionPointer func; 20 }; 21 22 // Initialize the GLES2 library. 23 GLES2_C_LIB_EXPORT void Initialize(); 24 25 // Terminate the GLES2 library. 26 GLES2_C_LIB_EXPORT void Terminate(); 27 28 // Get the current GL context. 29 GLES2_C_LIB_EXPORT gpu::gles2::GLES2Interface* GetGLContext(); 30 31 // Set the current GL context. 32 GLES2_C_LIB_EXPORT void SetGLContext(gpu::gles2::GLES2Interface* impl); 33 34 GLES2_C_LIB_EXPORT GLES2FunctionPointer GetGLFunctionPointer(const char* name); 35 36 } // namespace gles2 37 38 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 39