Struct glin::texture::DataFormat [−][src]
pub struct DataFormat {
pub width: u32,
pub height: u32,
pub depth: u32,
pub format: GLenum,
pub ty: GLenum,
pub level: u32,
pub xoffset: i32,
pub yoffset: i32,
pub zoffset: i32,
}Used to upload data to a Texture
DataFormat implements Default so when uploading data to a texture where the data and the
texture ahve the same size, format and type and the data is going to be uploaded to level 0
a Default DataFormat can be used by calling Default::default() or DataFormat::default()
If some fields are not the same the rest can be defaulted by using ..Default::default() as in
use glin::texture::DataFormat; texture.load_data(&data, DataFormat{ width: 20, height: 20, xoffset: 20, yoffset: 20, level: 1, ..Default::default() });
Fields
width: u32height: u32depth: u32format: GLenumty: GLenumlevel: u32xoffset: i32yoffset: i32zoffset: i32Implementations
impl DataFormat[src]
impl DataFormat[src]pub fn bytes(&self) -> Result<usize>[src]
pub fn fill_defaults_from(&mut self, tex: &Texture) -> Result<()>[src]
pub fn default_from(texture: &Texture) -> Result<DataFormat>[src]
Trait Implementations
impl Clone for DataFormat[src]
impl Clone for DataFormat[src]fn clone(&self) -> DataFormat[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Default for DataFormat[src]
impl Default for DataFormat[src]fn default() -> DataFormat[src]
impl Hash for DataFormat[src]
impl Hash for DataFormat[src]impl PartialEq<DataFormat> for DataFormat[src]
impl PartialEq<DataFormat> for DataFormat[src]fn eq(&self, other: &DataFormat) -> bool[src]
fn ne(&self, other: &DataFormat) -> bool[src]
impl TryFrom<Format> for DataFormat[src]
impl TryFrom<Format> for DataFormat[src]