1 #ifndef MSP_GL_OPENGL_EXTENSION_H_
2 #define MSP_GL_OPENGL_EXTENSION_H_
18 Holds metadata about an extension. Evaluates to true if the extension is
31 typedef SupportLevel (*InitFunc)();
36 mutable bool init_done;
37 mutable SupportLevel support;
40 Extension(const char *, InitFunc);
42 const char *get_name() const { return name; }
43 operator bool() const;
49 Require(const Extension &);
53 typedef void ExtFunc();
55 /** Checks for extension support. Only intended for internal use. */
56 bool is_supported(const std::string &);
58 /** Checks for OpenGL version support. Only intended for internal use. */
59 bool is_supported(const Version &, const Version & = Version());
61 /** Indicates whether an extension has been disabled, either explicitly through
62 the MSPGL_DISABLE_EXTENSIONS environment variable or implicitly as a workaround
63 for a driver bug. Only intended for internal use. */
64 bool is_disabled(const std::string &);
66 /** Returns the OpenGL profile for the active context. */
67 GLProfile get_gl_profile();
69 /** Returns the GLSL version number, as reported by the implementation. */
70 const Version &get_glsl_version();
72 /** Returns the address of an extension function. Only indended for internal
74 ExtFunc *get_proc_address(const std::string &);