]> git.tdb.fi Git - libs/gl.git/blob - source/core/backend.h
Use default member initializers for simple types
[libs/gl.git] / source / core / backend.h
1 #ifndef MSP_GL_BACKEND_H_
2 #define MSP_GL_BACKEND_H_
3
4 #include <string>
5
6 namespace Msp {
7 namespace GL {
8
9 enum GraphicsApi
10 {
11         OPENGL,
12         OPENGL_ES
13 };
14
15 struct Version
16 {
17         unsigned short major = 0;
18         unsigned short minor = 0;
19
20         Version() = default;
21         Version(unsigned short, unsigned short);
22         Version(const std::string &);
23
24         bool operator>=(const Version &) const;
25         bool operator<(const Version &o) const { return !(*this>=o); }
26         operator bool() const { return major || minor; }
27 };
28
29 /** Returns the backend for which the library was compiled. */
30 GraphicsApi get_backend_api();
31
32 /** Returns the backend version number, as reported by the implementation. */
33 const Version &get_backend_version();
34
35 } // namespace GL
36 } // namespace Msp
37
38 #endif