objc2_scene_kit/generated/
SCNRenderer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12#[cfg(feature = "objc2-metal")]
13#[cfg(not(target_os = "watchos"))]
14use objc2_metal::*;
15#[cfg(feature = "objc2-open-gl")]
16#[cfg(target_os = "macos")]
17use objc2_open_gl::*;
18
19use crate::*;
20
21extern_class!(
22 #[unsafe(super(NSObject))]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 pub struct SCNRenderer;
28);
29
30extern_conformance!(
31 unsafe impl NSObjectProtocol for SCNRenderer {}
32);
33
34#[cfg(feature = "SCNSceneRenderer")]
35extern_conformance!(
36 unsafe impl SCNSceneRenderer for SCNRenderer {}
37);
38
39#[cfg(feature = "SCNTechnique")]
40extern_conformance!(
41 unsafe impl SCNTechniqueSupport for SCNRenderer {}
42);
43
44impl SCNRenderer {
45 extern_methods!(
46 #[cfg(feature = "objc2-open-gl")]
47 #[cfg(target_os = "macos")]
48 #[unsafe(method(rendererWithContext:options:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn rendererWithContext_options(
61 context: CGLContextObj,
62 options: Option<&NSDictionary>,
63 ) -> Retained<Self>;
64
65 #[cfg(feature = "objc2-metal")]
66 #[cfg(not(target_os = "watchos"))]
67 #[unsafe(method(rendererWithDevice:options:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn rendererWithDevice_options(
79 device: Option<&ProtocolObject<dyn MTLDevice>>,
80 options: Option<&NSDictionary>,
81 ) -> Retained<Self>;
82
83 #[cfg(feature = "SCNScene")]
84 #[unsafe(method(scene))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn scene(&self) -> Option<Retained<SCNScene>>;
88
89 #[cfg(feature = "SCNScene")]
90 #[unsafe(method(setScene:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setScene(&self, scene: Option<&SCNScene>);
94
95 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-metal"))]
96 #[cfg(not(target_os = "watchos"))]
97 #[unsafe(method(renderAtTime:viewport:commandBuffer:passDescriptor:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn renderAtTime_viewport_commandBuffer_passDescriptor(
103 &self,
104 time: CFTimeInterval,
105 viewport: CGRect,
106 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
107 render_pass_descriptor: &MTLRenderPassDescriptor,
108 );
109
110 #[cfg(feature = "objc2-core-foundation")]
111 #[unsafe(method(renderAtTime:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn renderAtTime(&self, time: CFTimeInterval);
117
118 #[cfg(feature = "objc2-core-foundation")]
119 #[unsafe(method(updateAtTime:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn updateAtTime(&self, time: CFTimeInterval);
123
124 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-metal"))]
125 #[cfg(not(target_os = "watchos"))]
126 #[unsafe(method(renderWithViewport:commandBuffer:passDescriptor:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn renderWithViewport_commandBuffer_passDescriptor(
132 &self,
133 viewport: CGRect,
134 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
135 render_pass_descriptor: &MTLRenderPassDescriptor,
136 );
137
138 #[cfg(feature = "objc2-core-foundation")]
139 #[unsafe(method(nextFrameTime))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn nextFrameTime(&self) -> CFTimeInterval;
143
144 #[cfg(all(
145 feature = "SCNSceneRenderer",
146 feature = "objc2-app-kit",
147 feature = "objc2-core-foundation"
148 ))]
149 #[cfg(target_os = "macos")]
150 #[unsafe(method(snapshotAtTime:withSize:antialiasingMode:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn snapshotAtTime_withSize_antialiasingMode(
154 &self,
155 time: CFTimeInterval,
156 size: CGSize,
157 antialiasing_mode: SCNAntialiasingMode,
158 ) -> Retained<NSImage>;
159
160 #[cfg(all(feature = "SCNNode", feature = "objc2-core-foundation"))]
161 #[unsafe(method(updateProbes:atTime:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn updateProbes_atTime(
171 &self,
172 light_probes: &NSArray<SCNNode>,
173 time: CFTimeInterval,
174 );
175 );
176}
177
178impl SCNRenderer {
180 extern_methods!(
181 #[unsafe(method(init))]
182 #[unsafe(method_family = init)]
183 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
184
185 #[unsafe(method(new))]
186 #[unsafe(method_family = new)]
187 pub unsafe fn new() -> Retained<Self>;
188 );
189}