Made glfw window creation use a proper builder pattern

The main reason I changed this stuff yet again is that I tried to actually used it, and found it to be too restricted in practice. ;)

Specifically, with the previous `create_default_window()` it was impossible to add additional window hints to glfw, like for example making the window re-sizable.

With the new design, you can specify common window hints that should be applied regardless of which setup lead to an window creation, and you can also add custom fallbacks before and after the provided shortcut function.
No functionality has been deprecated since 3.0. I didn't know that you get
the most recent if you request a lower. If so, this seems fine.


On Sat, Jul 12, 2014 at 11:35 AM, Marvin Löbel <notifications@github.com>
wrote:

> In src/glfw_platform/lib.rs:
>
> > +    /// a modern OpenGL context version.
> > +    ///
> > +    /// Modern in this context is defined as providing
> > +    /// GLSL support, and providing as many extensions as possible,
> > +    /// ideally approaching version 3.2 or higher."
> > +    ///
> > +    /// Specifically, this adds two `try_hints()` call that try for 3.2 core and 2.0,
> > +    /// in that order.
> > +    ///
> > +    /// This method exists as a cross-platform compatible way to get a context that
> > +    /// supports newer OpenGL feature under OS X, as 10.7+ supports OpenGL
> > +    /// 3.2 but defaults to a 2.1 context that does _not_ expose the additional
> > +    /// extensions.
> > +    pub fn try_modern_context_hints(self)
> > +    -> WindowBuilder<'glfw, 'title, 'monitor> {
> > +        self.try_hints([
>
> I thought about that, but I had the feeling people would not like that :).
> Besides, it seems you end up with the most current version anyway if you
> request a lower versions, unless you are on OS X and request 2.1 or lower.
>
> I was also not sure if it *should* try higher than 3.2, due to backwards
> compatibility and such? Or did no functionality get deprecated between 3.2
> and 4.4?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/bjz/gfx-rs/pull/94/files#r14854715>.
>



-- 
http://octayn.net/