Texture binding + creation

Closes #49
I don't think we need to support this but the comment needs to state that decision.

Regards,
Dzmitry

> On Jul 19, 2014, at 14:07, Corey Richardson <notifications@github.com> wrote:
> 
> In src/device/tex.rs:
> 
> > +    Scale,
> > +    /// Add simple mipmapping.
> > +    Mipmap,
> > +    /// Sample multiple texels within a single mipmap level to increase
> > +    /// quality.
> > +    Bilinear,
> > +    /// Sample multiple texels across two mipmap levels to increase quality.
> > +    Trilinear,
> > +    /// Anisotropic filtering with a given "max", must be between 1 and 16,
> > +    /// inclusive.
> > +    Anisotropic(u8)
> > +}
> > +
> > +/// Specifies how a given texture may be used. This is mostly due to OpenGL
> > +/// and Metal being braindamaged and not allowing, for example, a texture
> > +/// previously used as Texture2D to be used as Texture3D. The available
> From the OpenGL 3.3 Spec, p136,
> 
> The new texture object bound to target is, and remains a texture of the dimensionality and type specified by target until it is deleted. BindTexture may also be used to bind an existing texture object to any of these targets. The error INVALID_OPERATION is generated if an attempt is made to bind a texture object of different dimensionality than the specified target. If the bind is successful no change is made to the state of the bound texture object, and any previous binding to target is broken.
> 
> I think I read this wrong the first time. If something was bound as Texture2D, you can later bind it as Texture1DArray, I think. That complexifies things a lot and seems like it'd be error prone to handle... As for Metal, textures are not bound to a given target to give them their type, they are created with that type and then immutable.
> 
> —
> Reply to this email directly or view it on GitHub.