1 #ifndef MSP_GL_EXTENSION_H_
2 #define MSP_GL_EXTENSION_H_
15 typedef void ExtFunc();
18 Indicates whether an extension is supported. If this returns true, the
19 functions of that extension are safe to use.
21 bool is_supported(const std::string &);
24 Checks that an extension is supported and throws if it isn't.
26 void require_extension(const std::string &);
29 RAII version of require_extension. Useful as a static local variable.
31 struct RequireExtension
33 RequireExtension(const std::string &e) { require_extension(e); }
37 Returns the OpenGL version number, as reported by the implementation.
38 Functions up to the returned version are safe to use.
40 const Version &get_gl_version();
43 Indicates whether the OpenGL version is at least a.b.
45 bool is_version_at_least(unsigned a, unsigned b);
48 Checks that the OpenGL version is at least a.b and throws if it isn't.
50 void require_version(unsigned a, unsigned b);
53 RAII version of require_version. Useful as a static local variable.
57 RequireVersion(unsigned a, unsigned b) { require_version(a, b); }
61 Returns the address of an extension function. Only indended for internal use.
63 ExtFunc *get_proc_address(const std::string &);