GNOME Bugzilla – Bug 744212
gdk_gl_context_set_required_version() interprets requests for 4.0 and 4.1 contexts as requests for 4.2 contexts
Last modified: 2015-02-10 10:53:02 UTC
Created attachment 296438 [details] [review] Allow OpenGL 4.0 and 4.1 contexts to be created Simple logic error while trying to set 3.2 as a minimum GL version.
the second branch is not really needed: else if (major < 3) priv->minor = 2; since we don't allow the major version to be less than 3; if you specify (0,0) then we simply set the version to (3,2). I pushed a different patch, but thanks!
It seems like it's still wrong to me. If someone misguidedly requests version 2.1 then they will get version 3.1. With my original patch they would still get the minimum 3.2.
Perhaps a more elegant solution would be to simply convert the version to a single number, perform a simple minimum, then convert back to a major/minor pair int version = MAX (major * 100 + minor, 320); prev->major = version / 100; prev->minor = version % 100; It would break if we see more than 100 minor revisions I suppose but I think we can rule that out.
(In reply to Niels Nesse from comment #2) > It seems like it's still wrong to me. If someone misguidedly requests > version 2.1 then they will get version 3.1. With my original patch they > would still get the minimum 3.2. Nevermind it's correct. I didn't notice at first that you checked "priv->major" and not "major". Thanks.