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; }
47 typedef SupportLevel (*InitFunc)();
52 mutable bool init_done;
53 mutable SupportLevel support;
56 Extension(const char *, InitFunc);
58 const char *get_name() const { return name; }
59 operator bool() const;
65 Require(const Extension &);
69 typedef void ExtFunc();
71 /** Checks for extension support. Only intended for internal use. */
72 bool is_supported(const std::string &);
74 /** Checks for OpenGL version support. Only intended for internal use. */
75 bool is_supported(const Version &, const Version & = Version());
77 /** Indicates whether an extension has been disabled, either explicitly through
78 the MSPGL_DISABLE_EXTENSIONS environment variable or implicitly as a workaround
79 for a driver bug. Only intended for internal use. */
80 bool is_disabled(const std::string &);
82 /** Returns the API for which the library was compiled. */
85 /** Returns the OpenGL profile for the active context. */
86 GLProfile get_gl_profile();
88 /** Returns the OpenGL version number, as reported by the implementation. */
89 const Version &get_gl_version();
91 /** Returns the GLSL version number, as reported by the implementation. */
92 const Version &get_glsl_version();
94 /** Returns the address of an extension function. Only indended for internal
96 ExtFunc *get_proc_address(const std::string &);