1 // Copyright (C) 2015 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef GLCOMMON_GL_LIBRARY_H 16 #define GLCOMMON_GL_LIBRARY_H 17 18 // An interface class used to model the desktop GL library to use at runtime. 19 // Use GlLibrary::getHostInstance() to retrieve the instance corresponding 20 // to the host's default system GL library. 21 class GlLibrary { 22 public: 23 // Generic pointer-to-function type. 24 typedef void (*GlFunctionPointer)(void); 25 26 // Empty constructor. GlLibrary()27 GlLibrary() {} 28 29 // Empty destructor. ~GlLibrary()30 virtual ~GlLibrary() {} 31 32 // Find the function named |name| in the library and return its address. 33 virtual GlFunctionPointer findSymbol(const char* name) = 0; 34 }; 35 36 #endif // GLCOMMON_GL_LIBRARY_H 37