1 #ifndef MSP_GL_EXTENSION_H_
2 #define MSP_GL_EXTENSION_H_
28 Version(unsigned short, unsigned short);
29 Version(const std::string &);
31 bool operator>=(const Version &) const;
32 bool operator<(const Version &o) const { return !(*this>=o); }
33 operator bool() const { return major || minor; }
38 Holds metadata about an extension. Evaluates to true if the extension is
51 typedef SupportLevel (*InitFunc)();
56 mutable bool init_done;
57 mutable SupportLevel support;
60 Extension(const char *, InitFunc);
62 const char *get_name() const { return name; }
63 operator bool() const;
69 Require(const Extension &);
73 typedef void ExtFunc();
75 /** Checks for extension support. Only intended for internal use. */
76 bool is_supported(const std::string &);
78 /** Checks for OpenGL version support. Only intended for internal use. */
79 bool is_supported(const Version &, const Version & = Version());
81 /** Indicates whether an extension has been disabled, either explicitly through
82 the MSPGL_DISABLE_EXTENSIONS environment variable or implicitly as a workaround
83 for a driver bug. Only intended for internal use. */
84 bool is_disabled(const std::string &);
86 /** Returns the API for which the library was compiled. */
89 /** Returns the OpenGL profile for the active context. */
90 GLProfile get_gl_profile();
92 /** Returns the OpenGL version number, as reported by the implementation. */
93 const Version &get_gl_version();
95 /** Returns the GLSL version number, as reported by the implementation. */
96 const Version &get_glsl_version();
98 /** Returns the address of an extension function. Only indended for internal
100 ExtFunc *get_proc_address(const std::string &);