use objc2::{
extern_class, extern_conformance, extern_methods,
rc::Retained,
runtime::{NSObject, ProtocolObject},
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use super::{MTLLoadAction, MTLStoreAction, MTLStoreActionOptions};
use crate::MTLTexture;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLRenderPassAttachmentDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLRenderPassAttachmentDescriptor {}
);
unsafe impl CopyingHelper for MTLRenderPassAttachmentDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLRenderPassAttachmentDescriptor {}
);
impl MTLRenderPassAttachmentDescriptor {
extern_methods!(
#[unsafe(method(texture))]
#[unsafe(method_family = none)]
pub fn texture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;
#[unsafe(method(setTexture:))]
#[unsafe(method_family = none)]
pub fn set_texture(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
);
#[unsafe(method(level))]
#[unsafe(method_family = none)]
pub fn level(&self) -> usize;
#[unsafe(method(setLevel:))]
#[unsafe(method_family = none)]
pub fn set_level(
&self,
level: usize,
);
#[unsafe(method(slice))]
#[unsafe(method_family = none)]
pub fn slice(&self) -> usize;
#[unsafe(method(setSlice:))]
#[unsafe(method_family = none)]
pub fn set_slice(
&self,
slice: usize,
);
#[unsafe(method(depthPlane))]
#[unsafe(method_family = none)]
pub fn depth_plane(&self) -> usize;
#[unsafe(method(setDepthPlane:))]
#[unsafe(method_family = none)]
pub fn set_depth_plane(
&self,
depth_plane: usize,
);
#[unsafe(method(loadAction))]
#[unsafe(method_family = none)]
pub fn load_action(&self) -> MTLLoadAction;
#[unsafe(method(setLoadAction:))]
#[unsafe(method_family = none)]
pub fn set_load_action(
&self,
load_action: MTLLoadAction,
);
#[unsafe(method(storeAction))]
#[unsafe(method_family = none)]
pub fn store_action(&self) -> MTLStoreAction;
#[unsafe(method(setStoreAction:))]
#[unsafe(method_family = none)]
pub fn set_store_action(
&self,
store_action: MTLStoreAction,
);
#[unsafe(method(storeActionOptions))]
#[unsafe(method_family = none)]
pub fn store_action_options(&self) -> MTLStoreActionOptions;
#[unsafe(method(setStoreActionOptions:))]
#[unsafe(method_family = none)]
pub fn set_store_action_options(
&self,
options: MTLStoreActionOptions,
);
);
}