Struct glitter::texture::VariantTexture2d
[−]
[src]
pub struct VariantTexture2d;
This is a unit type that is used to be coerced into select enum variants.
In OpenGL, the GL_TEXTURE_2D
enum value is used for multiple purposes. In
particular, it can be used as both a valid argument for glBindTexture
(where it represents a possible texture
binding, which maps to TextureBindingTarget::Texture2d
in glitter) and for glTexImage2D
(where it represents the possible
2D images that make up a particular texture type, which maps to
the ImageTargetType
trait and
the Tx2dImageTarget
enum in glitter).
Thus, in order to be able to use the constant glitter::TEXTURE_2D
as an
argument to the image_2d
method, glitter::TEXTURE_2D
must be of type TextureBindingTarget
. But, in order to be able to it as an
argument to a method that takes Tx2dImageTarget
, it must be of type [Tx2dImageTarget
]
both types, so this type exists solely to be the type of
glitter::TEXTURE_2D
, and it implements From
so that it can be converted
to either type freely.
Trait Implementations
impl From<VariantTexture2d> for TextureBindingTarget
[src]
fn from(_: VariantTexture2d) -> TextureBindingTarget
[src]
Performs the conversion.
impl From<VariantTexture2d> for Tx2dImageTarget
[src]
fn from(_: VariantTexture2d) -> Tx2dImageTarget
[src]
Performs the conversion.