X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbackend.h;fp=source%2Fcore%2Fbackend.h;h=0dd0172c503637a388932468a4439d1d12ebd959;hb=e6077f9f25b794c174e1017c2c0763e77a6fddda;hp=0000000000000000000000000000000000000000;hpb=8e553af57b712051f47293c971671f4f6a939be2;p=libs%2Fgl.git diff --git a/source/core/backend.h b/source/core/backend.h new file mode 100644 index 00000000..0dd0172c --- /dev/null +++ b/source/core/backend.h @@ -0,0 +1,38 @@ +#ifndef MSP_GL_BACKEND_H_ +#define MSP_GL_BACKEND_H_ + +#include + +namespace Msp { +namespace GL { + +enum GraphicsApi +{ + OPENGL, + OPENGL_ES +}; + +struct Version +{ + unsigned short major; + unsigned short minor; + + Version(); + Version(unsigned short, unsigned short); + Version(const std::string &); + + bool operator>=(const Version &) const; + bool operator<(const Version &o) const { return !(*this>=o); } + operator bool() const { return major || minor; } +}; + +/** Returns the backend for which the library was compiled. */ +GraphicsApi get_backend_api(); + +/** Returns the backend version number, as reported by the implementation. */ +const Version &get_backend_version(); + +} // namespace GL +} // namespace Msp + +#endif