]> git.tdb.fi Git - libs/gl.git/blob - source/core/backend.cpp
ac9e22b7d2a5ebadc7606d7dc9e065862921c18e
[libs/gl.git] / source / core / backend.cpp
1 #include <msp/strings/lexicalcast.h>
2 #include <msp/strings/utils.h>
3 #include "backend.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace GL {
9
10 Version::Version()
11 {
12         major = 0;
13         minor = 0;
14 }
15
16 Version::Version(unsigned short a, unsigned short i)
17 {
18         major = a;
19         minor = i;
20 }
21
22 Version::Version(const string &s)
23 {
24         vector<string> parts = split(s, '.');
25         major = lexical_cast<unsigned>(parts[0]);
26         minor = lexical_cast<unsigned>(parts[1]);
27 }
28
29 bool Version::operator>=(const Version &other) const
30 {
31         return major>other.major || (major==other.major && minor>=other.minor);
32 }
33
34 } // namespace GL
35 } // namespace Msp