maxcountryman_web_sys/features/
gen_GpuPrimitiveState.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPrimitiveState)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuPrimitiveState` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type GpuPrimitiveState;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuPrimitiveState {
19 #[doc = "Construct a new `GpuPrimitiveState`."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"]
22 #[doc = ""]
23 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 pub fn new() -> Self {
26 #[allow(unused_mut)]
27 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28 ret
29 }
30 #[cfg(web_sys_unstable_apis)]
31 #[doc = "Change the `clampDepth` field of this object."]
32 #[doc = ""]
33 #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"]
34 #[doc = ""]
35 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
36 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
37 pub fn clamp_depth(&mut self, val: bool) -> &mut Self {
38 use wasm_bindgen::JsValue;
39 let r = ::js_sys::Reflect::set(
40 self.as_ref(),
41 &JsValue::from("clampDepth"),
42 &JsValue::from(val),
43 );
44 debug_assert!(
45 r.is_ok(),
46 "setting properties should never fail on our dictionary objects"
47 );
48 let _ = r;
49 self
50 }
51 #[cfg(web_sys_unstable_apis)]
52 #[cfg(feature = "GpuCullMode")]
53 #[doc = "Change the `cullMode` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"]
56 #[doc = ""]
57 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
58 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
59 pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self {
60 use wasm_bindgen::JsValue;
61 let r = ::js_sys::Reflect::set(
62 self.as_ref(),
63 &JsValue::from("cullMode"),
64 &JsValue::from(val),
65 );
66 debug_assert!(
67 r.is_ok(),
68 "setting properties should never fail on our dictionary objects"
69 );
70 let _ = r;
71 self
72 }
73 #[cfg(web_sys_unstable_apis)]
74 #[cfg(feature = "GpuFrontFace")]
75 #[doc = "Change the `frontFace` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuPrimitiveState`*"]
78 #[doc = ""]
79 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
80 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
81 pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self {
82 use wasm_bindgen::JsValue;
83 let r = ::js_sys::Reflect::set(
84 self.as_ref(),
85 &JsValue::from("frontFace"),
86 &JsValue::from(val),
87 );
88 debug_assert!(
89 r.is_ok(),
90 "setting properties should never fail on our dictionary objects"
91 );
92 let _ = r;
93 self
94 }
95 #[cfg(web_sys_unstable_apis)]
96 #[cfg(feature = "GpuIndexFormat")]
97 #[doc = "Change the `stripIndexFormat` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuPrimitiveState`*"]
100 #[doc = ""]
101 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
103 pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self {
104 use wasm_bindgen::JsValue;
105 let r = ::js_sys::Reflect::set(
106 self.as_ref(),
107 &JsValue::from("stripIndexFormat"),
108 &JsValue::from(val),
109 );
110 debug_assert!(
111 r.is_ok(),
112 "setting properties should never fail on our dictionary objects"
113 );
114 let _ = r;
115 self
116 }
117 #[cfg(web_sys_unstable_apis)]
118 #[cfg(feature = "GpuPrimitiveTopology")]
119 #[doc = "Change the `topology` field of this object."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuPrimitiveTopology`*"]
122 #[doc = ""]
123 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
125 pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self {
126 use wasm_bindgen::JsValue;
127 let r = ::js_sys::Reflect::set(
128 self.as_ref(),
129 &JsValue::from("topology"),
130 &JsValue::from(val),
131 );
132 debug_assert!(
133 r.is_ok(),
134 "setting properties should never fail on our dictionary objects"
135 );
136 let _ = r;
137 self
138 }
139}
140#[cfg(web_sys_unstable_apis)]
141impl Default for GpuPrimitiveState {
142 fn default() -> Self {
143 Self::new()
144 }
145}