Skip to content

Commit

Permalink
Add MTLTextureCompressionType (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili authored Jun 13, 2022
1 parent e8e1978 commit 276aa29
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ pub enum MTLTextureType {
D3 = 7,
}

#[repr(u64)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum MTLTextureCompressionType {
Lossless = 0,
Lossy = 1,
}

bitflags! {
pub struct MTLTextureUsage: NSUInteger {
const Unknown = 0x0000;
Expand Down Expand Up @@ -156,6 +163,14 @@ impl TextureDescriptorRef {
pub fn set_usage(&self, usage: MTLTextureUsage) {
unsafe { msg_send![self, setUsage: usage] }
}

pub fn compression_type(&self) -> MTLTextureCompressionType {
unsafe { msg_send![self, compressionType] }
}

pub fn set_compression_type(&self, compression_type: MTLTextureCompressionType) {
unsafe { msg_send![self, setCompressionType: compression_type] }
}
}

pub enum MTLTexture {}
Expand Down

0 comments on commit 276aa29

Please sign in to comment.