objc2_sprite_kit/generated/
SKUniform.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-gl-kit")]
8#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
9use objc2_gl_kit::*;
10
11use crate::*;
12
13#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct SKUniformType(pub NSInteger);
18impl SKUniformType {
19 #[doc(alias = "SKUniformTypeNone")]
20 pub const None: Self = Self(0);
21 #[doc(alias = "SKUniformTypeFloat")]
22 pub const Float: Self = Self(1);
23 #[doc(alias = "SKUniformTypeFloatVector2")]
24 pub const FloatVector2: Self = Self(2);
25 #[doc(alias = "SKUniformTypeFloatVector3")]
26 pub const FloatVector3: Self = Self(3);
27 #[doc(alias = "SKUniformTypeFloatVector4")]
28 pub const FloatVector4: Self = Self(4);
29 #[doc(alias = "SKUniformTypeFloatMatrix2")]
30 pub const FloatMatrix2: Self = Self(5);
31 #[doc(alias = "SKUniformTypeFloatMatrix3")]
32 pub const FloatMatrix3: Self = Self(6);
33 #[doc(alias = "SKUniformTypeFloatMatrix4")]
34 pub const FloatMatrix4: Self = Self(7);
35 #[doc(alias = "SKUniformTypeTexture")]
36 pub const Texture: Self = Self(8);
37}
38
39unsafe impl Encode for SKUniformType {
40 const ENCODING: Encoding = NSInteger::ENCODING;
41}
42
43unsafe impl RefEncode for SKUniformType {
44 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47extern_class!(
48 #[unsafe(super(NSObject))]
50 #[derive(Debug, PartialEq, Eq, Hash)]
51 pub struct SKUniform;
52);
53
54extern_conformance!(
55 unsafe impl NSCoding for SKUniform {}
56);
57
58extern_conformance!(
59 unsafe impl NSCopying for SKUniform {}
60);
61
62unsafe impl CopyingHelper for SKUniform {
63 type Result = Self;
64}
65
66extern_conformance!(
67 unsafe impl NSObjectProtocol for SKUniform {}
68);
69
70extern_conformance!(
71 unsafe impl NSSecureCoding for SKUniform {}
72);
73
74impl SKUniform {
75 extern_methods!(
76 #[unsafe(method(uniformWithName:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn uniformWithName(name: &NSString) -> Retained<Self>;
83
84 #[cfg(feature = "SKTexture")]
85 #[unsafe(method(uniformWithName:texture:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn uniformWithName_texture(
94 name: &NSString,
95 texture: Option<&SKTexture>,
96 ) -> Retained<Self>;
97
98 #[unsafe(method(uniformWithName:float:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn uniformWithName_float(name: &NSString, value: c_float) -> Retained<Self>;
107
108 #[unsafe(method(name))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn name(&self) -> Retained<NSString>;
111
112 #[unsafe(method(uniformType))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn uniformType(&self) -> SKUniformType;
115
116 #[cfg(feature = "SKTexture")]
117 #[unsafe(method(textureValue))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn textureValue(&self) -> Option<Retained<SKTexture>>;
120
121 #[cfg(feature = "SKTexture")]
122 #[unsafe(method(setTextureValue:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setTextureValue(&self, texture_value: Option<&SKTexture>);
126
127 #[unsafe(method(floatValue))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn floatValue(&self) -> c_float;
130
131 #[unsafe(method(setFloatValue:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setFloatValue(&self, float_value: c_float);
135
136 #[unsafe(method(initWithName:))]
137 #[unsafe(method_family = init)]
138 pub unsafe fn initWithName(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
139
140 #[cfg(feature = "SKTexture")]
141 #[unsafe(method(initWithName:texture:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initWithName_texture(
144 this: Allocated<Self>,
145 name: &NSString,
146 texture: Option<&SKTexture>,
147 ) -> Retained<Self>;
148
149 #[unsafe(method(initWithName:float:))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn initWithName_float(
152 this: Allocated<Self>,
153 name: &NSString,
154 value: c_float,
155 ) -> Retained<Self>;
156
157 #[cfg(feature = "objc2-gl-kit")]
158 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
159 #[deprecated]
163 #[unsafe(method(floatVector2Value))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn floatVector2Value(&self) -> GLKVector2;
166
167 #[cfg(feature = "objc2-gl-kit")]
168 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
169 #[deprecated]
175 #[unsafe(method(setFloatVector2Value:))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn setFloatVector2Value(&self, float_vector2_value: GLKVector2);
178
179 #[cfg(feature = "objc2-gl-kit")]
180 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
181 #[deprecated]
185 #[unsafe(method(floatVector3Value))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn floatVector3Value(&self) -> GLKVector3;
188
189 #[cfg(feature = "objc2-gl-kit")]
190 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
191 #[deprecated]
197 #[unsafe(method(setFloatVector3Value:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn setFloatVector3Value(&self, float_vector3_value: GLKVector3);
200
201 #[cfg(feature = "objc2-gl-kit")]
202 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
203 #[deprecated]
207 #[unsafe(method(floatVector4Value))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn floatVector4Value(&self) -> GLKVector4;
210
211 #[cfg(feature = "objc2-gl-kit")]
212 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
213 #[deprecated]
219 #[unsafe(method(setFloatVector4Value:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn setFloatVector4Value(&self, float_vector4_value: GLKVector4);
222
223 #[cfg(feature = "objc2-gl-kit")]
224 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
225 #[deprecated]
229 #[unsafe(method(floatMatrix2Value))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn floatMatrix2Value(&self) -> GLKMatrix2;
232
233 #[cfg(feature = "objc2-gl-kit")]
234 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
235 #[deprecated]
241 #[unsafe(method(setFloatMatrix2Value:))]
242 #[unsafe(method_family = none)]
243 pub unsafe fn setFloatMatrix2Value(&self, float_matrix2_value: GLKMatrix2);
244
245 #[cfg(feature = "objc2-gl-kit")]
246 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
247 #[deprecated]
251 #[unsafe(method(floatMatrix3Value))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn floatMatrix3Value(&self) -> GLKMatrix3;
254
255 #[cfg(feature = "objc2-gl-kit")]
256 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
257 #[deprecated]
263 #[unsafe(method(setFloatMatrix3Value:))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn setFloatMatrix3Value(&self, float_matrix3_value: GLKMatrix3);
266
267 #[cfg(feature = "objc2-gl-kit")]
268 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
269 #[deprecated]
273 #[unsafe(method(floatMatrix4Value))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn floatMatrix4Value(&self) -> GLKMatrix4;
276
277 #[cfg(feature = "objc2-gl-kit")]
278 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
279 #[deprecated]
285 #[unsafe(method(setFloatMatrix4Value:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn setFloatMatrix4Value(&self, float_matrix4_value: GLKMatrix4);
288
289 #[cfg(feature = "objc2-gl-kit")]
290 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
291 #[deprecated]
295 #[unsafe(method(uniformWithName:floatVector2:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn uniformWithName_floatVector2(
298 name: &NSString,
299 value: GLKVector2,
300 ) -> Retained<Self>;
301
302 #[cfg(feature = "objc2-gl-kit")]
303 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
304 #[deprecated]
308 #[unsafe(method(uniformWithName:floatVector3:))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn uniformWithName_floatVector3(
311 name: &NSString,
312 value: GLKVector3,
313 ) -> Retained<Self>;
314
315 #[cfg(feature = "objc2-gl-kit")]
316 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
317 #[deprecated]
321 #[unsafe(method(uniformWithName:floatVector4:))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn uniformWithName_floatVector4(
324 name: &NSString,
325 value: GLKVector4,
326 ) -> Retained<Self>;
327
328 #[cfg(feature = "objc2-gl-kit")]
329 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
330 #[deprecated]
334 #[unsafe(method(uniformWithName:floatMatrix2:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn uniformWithName_floatMatrix2(
337 name: &NSString,
338 value: GLKMatrix2,
339 ) -> Retained<Self>;
340
341 #[cfg(feature = "objc2-gl-kit")]
342 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
343 #[deprecated]
347 #[unsafe(method(uniformWithName:floatMatrix3:))]
348 #[unsafe(method_family = none)]
349 pub unsafe fn uniformWithName_floatMatrix3(
350 name: &NSString,
351 value: GLKMatrix3,
352 ) -> Retained<Self>;
353
354 #[cfg(feature = "objc2-gl-kit")]
355 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
356 #[deprecated]
360 #[unsafe(method(uniformWithName:floatMatrix4:))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn uniformWithName_floatMatrix4(
363 name: &NSString,
364 value: GLKMatrix4,
365 ) -> Retained<Self>;
366
367 #[cfg(feature = "objc2-gl-kit")]
368 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
369 #[deprecated]
373 #[unsafe(method(initWithName:floatVector2:))]
374 #[unsafe(method_family = init)]
375 pub unsafe fn initWithName_floatVector2(
376 this: Allocated<Self>,
377 name: &NSString,
378 value: GLKVector2,
379 ) -> Retained<Self>;
380
381 #[cfg(feature = "objc2-gl-kit")]
382 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
383 #[deprecated]
387 #[unsafe(method(initWithName:floatVector3:))]
388 #[unsafe(method_family = init)]
389 pub unsafe fn initWithName_floatVector3(
390 this: Allocated<Self>,
391 name: &NSString,
392 value: GLKVector3,
393 ) -> Retained<Self>;
394
395 #[cfg(feature = "objc2-gl-kit")]
396 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
397 #[deprecated]
401 #[unsafe(method(initWithName:floatVector4:))]
402 #[unsafe(method_family = init)]
403 pub unsafe fn initWithName_floatVector4(
404 this: Allocated<Self>,
405 name: &NSString,
406 value: GLKVector4,
407 ) -> Retained<Self>;
408
409 #[cfg(feature = "objc2-gl-kit")]
410 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
411 #[deprecated]
415 #[unsafe(method(initWithName:floatMatrix2:))]
416 #[unsafe(method_family = init)]
417 pub unsafe fn initWithName_floatMatrix2(
418 this: Allocated<Self>,
419 name: &NSString,
420 value: GLKMatrix2,
421 ) -> Retained<Self>;
422
423 #[cfg(feature = "objc2-gl-kit")]
424 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
425 #[deprecated]
429 #[unsafe(method(initWithName:floatMatrix3:))]
430 #[unsafe(method_family = init)]
431 pub unsafe fn initWithName_floatMatrix3(
432 this: Allocated<Self>,
433 name: &NSString,
434 value: GLKMatrix3,
435 ) -> Retained<Self>;
436
437 #[cfg(feature = "objc2-gl-kit")]
438 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
439 #[deprecated]
443 #[unsafe(method(initWithName:floatMatrix4:))]
444 #[unsafe(method_family = init)]
445 pub unsafe fn initWithName_floatMatrix4(
446 this: Allocated<Self>,
447 name: &NSString,
448 value: GLKMatrix4,
449 ) -> Retained<Self>;
450 );
451}
452
453impl SKUniform {
455 extern_methods!(
456 #[unsafe(method(init))]
457 #[unsafe(method_family = init)]
458 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
459
460 #[unsafe(method(new))]
461 #[unsafe(method_family = new)]
462 pub unsafe fn new() -> Retained<Self>;
463 );
464}