]> git.mxchange.org Git - simgear.git/blob - simgear/scene/material/GLPredicate.cxx
Use of copy-constructors
[simgear.git] / simgear / scene / material / GLPredicate.cxx
1 #include <simgear/scene/material/GLPredicate.hxx>
2
3 #include <algorithm>
4 #include <boost/bind.hpp>
5
6 #include <osg/GLExtensions>
7 #include <osg/Math>
8
9 namespace simgear
10 {
11 using namespace std;
12 using namespace osg;
13 using namespace boost;
14
15 bool GLPredicate::operator ()(unsigned int contextID)
16 {
17     float versionNumber = getGLVersionNumber() * 10.0f;
18     float required = (static_cast<float>(majorVersion) * 10.0f
19                       + static_cast<float>(minorVersion));
20     if (versionNumber < required
21         && !osg::equivalent(versionNumber, required))
22         return false;
23     return (find_if(extensions.begin(), extensions.end(),
24                     !bind(isGLExtensionSupported, contextID,
25                           bind(&string::c_str, _1)))
26             == extensions.end());
27 }
28 }