]> git.tdb.fi Git - libs/gl.git/commitdiff
Add a less-than operator to Version
authorMikko Rasa <tdb@tdb.fi>
Sun, 6 Nov 2016 09:34:00 +0000 (11:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 6 Nov 2016 10:45:57 +0000 (12:45 +0200)
source/extension.cpp
source/extension.h
source/programbuilder.cpp

index 78fc7e1c3c767caf5c7ac10693ca3ebc0e947aab..fda183d22f374ea309851019fbcc4f271d8d430a 100644 (file)
@@ -105,7 +105,7 @@ bool is_supported(const string &ext)
 
                                /* AMD's uniform buffer objects only work with the core version of
                                shaders. */
-                               if(!(get_gl_version()>=Version(2, 0)))
+                               if(get_gl_version()<Version(2, 0))
                                        extensions.erase("GL_ARB_uniform_buffer_object");
                        }
                }
index 85b4fc4af27e0418bf9d4c09932ad835899724f6..b44d89007c12610344347632c441d175cc5ff89a 100644 (file)
@@ -29,6 +29,7 @@ struct Version
        Version(const std::string &);
 
        bool operator>=(const Version &) const;
+       bool operator<(const Version &o) const { return !(*this>=o); }
 };
 
 
index affc4cc30e2b26ca109e0c9d4eeebe72c430c407..e4739da0b738a5fd727bfe53410aaec0a40238de 100644 (file)
@@ -782,9 +782,9 @@ ProgramBuilder::StandardFeatures::StandardFeatures():
        geometry(false)
 {
        if(get_gl_api()==OPENGL_ES2)
-               legacy = !(get_glsl_version()>=Version(3, 0));
+               legacy = get_glsl_version()<Version(3, 0);
        else
-               legacy = !(get_glsl_version()>=Version(1, 30));
+               legacy = get_glsl_version()<Version(1, 30);
 }
 
 string ProgramBuilder::StandardFeatures::create_flags() const