00001 #ifndef GLEW_SINGLETON_H_IS_INCLUDED 00002 #define GLEW_SINGLETON_H_IS_INCLUDED 00003 00004 /*! 00005 * \file glew_singleton.H 00006 * \brief Contains the definition of the GLEWSingleton class. 00007 * 00008 * \sa glew_singleton.C 00009 * 00010 */ 00011 00012 /*! 00013 * \brief A singleton class that provides a uniform access point for GLEW 00014 * functionality and makes sure that GLEW is initialized before it is used. 00015 * 00016 */ 00017 class GLEWSingleton { 00018 00019 public: 00020 00021 inline static GLEWSingleton &Instance(); 00022 00023 //! \brief Has GLEW been initialized successfully. 00024 bool is_initialized() { return initialized; } 00025 00026 //! \brief Are all the extensions listed in \p extension_names supported? 00027 bool is_supported(const char *extension_names); 00028 00029 private: 00030 00031 bool initialized; 00032 00033 GLEWSingleton(); 00034 GLEWSingleton(const GLEWSingleton &); 00035 00036 ~GLEWSingleton(); 00037 00038 GLEWSingleton &operator=(const GLEWSingleton &); 00039 00040 }; 00041 00042 inline GLEWSingleton& 00043 GLEWSingleton::Instance() 00044 { 00045 00046 static GLEWSingleton instance; 00047 return instance; 00048 00049 } 00050 00051 #endif // GLEW_SINGLETON_H_IS_INCLUDED