webgl_rs/
uniform_location.rs

1//! WebGLUniformLocation and methods
2use rendering_context::WebGL2RenderingContext;
3use wasm_bindgen::prelude::*;
4
5#[derive(Clone)]
6pub struct WebGLRSUniformLocation<'ctx> {
7    pub(crate) context: &'ctx WebGL2RenderingContext,
8    pub(crate) inner: WebGLUniformLocation,
9}
10
11impl<'ctx> WebGLRSUniformLocation<'ctx> {}
12
13/// WebGLUniformLocation
14#[wasm_bindgen]
15#[derive(Clone, Copy)]
16extern "C" {
17    /// FIXME: would prefer this to be pub(crate) but does not seem to work, not sure if it is a limitation of wasm_bindgen
18    /// or if it is just not possible in rust.
19    #[derive(Clone)]
20    pub type WebGLUniformLocation;
21
22    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
23    #[wasm_bindgen(method, js_name = uniform1f)]
24    pub fn uniform_1f(this: &WebGL2RenderingContext, location: &WebGLUniformLocation, v0: f32);
25
26    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
27    #[wasm_bindgen(method, js_name = uniform2f)]
28    pub fn uniform_2f(
29        this: &WebGL2RenderingContext,
30        location: &WebGLUniformLocation,
31        v0: f32,
32        v1: f32,
33    );
34
35    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
36    #[wasm_bindgen(method, js_name = uniform3f)]
37    pub fn uniform_3f(
38        this: &WebGL2RenderingContext,
39        location: &WebGLUniformLocation,
40        v0: f32,
41        v1: f32,
42        v2: f32,
43    );
44
45    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
46    #[wasm_bindgen(method, js_name = uniform4f)]
47    pub fn uniform_4f(
48        this: &WebGL2RenderingContext,
49        location: &WebGLUniformLocation,
50        v0: f32,
51        v1: f32,
52        v2: f32,
53        v3: f32,
54    );
55
56    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
57    #[wasm_bindgen(method, js_name = uniform1i)]
58    pub fn uniform_1i(this: &WebGL2RenderingContext, location: &WebGLUniformLocation, v0: i32);
59
60    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
61    #[wasm_bindgen(method, js_name = uniform2i)]
62    pub fn uniform_2i(
63        this: &WebGL2RenderingContext,
64        location: &WebGLUniformLocation,
65        v0: i32,
66        v1: i32,
67    );
68
69    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
70    #[wasm_bindgen(method, js_name = uniform3i)]
71    pub fn uniform_3i(
72        this: &WebGL2RenderingContext,
73        location: &WebGLUniformLocation,
74        v0: i32,
75        v1: i32,
76        v2: i32,
77    );
78
79    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
80    #[wasm_bindgen(method, js_name = uniform4i)]
81    pub fn uniform_4i(
82        this: &WebGL2RenderingContext,
83        location: &WebGLUniformLocation,
84        v0: i32,
85        v1: i32,
86        v2: i32,
87        v3: i32,
88    );
89
90    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
91    #[wasm_bindgen(method, js_name = uniform1fv)]
92    pub fn uniform_1fv(
93        this: &WebGL2RenderingContext,
94        location: &WebGLUniformLocation,
95        value: Vec<f32>,
96    );
97
98    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
99    #[wasm_bindgen(method, js_name = uniform2fv)]
100    pub fn uniform_2fv(
101        this: &WebGL2RenderingContext,
102        location: &WebGLUniformLocation,
103        value: Vec<f32>,
104    );
105
106    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
107    #[wasm_bindgen(method, js_name = uniform3fv)]
108    pub fn uniform_3fv(
109        this: &WebGL2RenderingContext,
110        location: &WebGLUniformLocation,
111        value: Vec<f32>,
112    );
113
114    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
115    #[wasm_bindgen(method, js_name = uniform4fv)]
116    pub fn uniform_4fv(
117        this: &WebGL2RenderingContext,
118        location: &WebGLUniformLocation,
119        value: Vec<f32>,
120    );
121
122    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
123    #[wasm_bindgen(method, js_name = uniform1iv)]
124    pub fn uniform_1iv(
125        this: &WebGL2RenderingContext,
126        location: &WebGLUniformLocation,
127        value: Vec<i32>,
128    );
129
130    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
131    #[wasm_bindgen(method, js_name = uniform2iv)]
132    pub fn uniform_2iv(
133        this: &WebGL2RenderingContext,
134        location: &WebGLUniformLocation,
135        value: Vec<i32>,
136    );
137
138    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
139    #[wasm_bindgen(method, js_name = uniform3iv)]
140    pub fn uniform_3iv(
141        this: &WebGL2RenderingContext,
142        location: &WebGLUniformLocation,
143        value: Vec<i32>,
144    );
145
146    /// The `WebGLRenderingContext.uniform[1234][fi][v]()` methods of the WebGL API specify values of uniform variables.
147    #[wasm_bindgen(method, js_name = uniform4iv)]
148    pub fn uniform_4iv(
149        this: &WebGL2RenderingContext,
150        location: &WebGLUniformLocation,
151        value: Vec<i32>,
152    );
153
154    /// The `WebGLRenderingContext.uniformMatrix[234]fv()` methods of the WebGL API specify matrix values for
155    /// uniform variables.
156    #[wasm_bindgen(method, js_name = uniformMatrix2fv)]
157    pub fn uniform_matrix_2fv(
158        this: &WebGL2RenderingContext,
159        location: &WebGLUniformLocation,
160        transpose: bool,
161        value: Vec<f32>,
162    );
163
164    /// The `WebGLRenderingContext.uniformMatrix[234]fv()` methods of the WebGL API specify matrix values for
165    /// uniform variables.
166    #[wasm_bindgen(method, js_name = uniformMatrix3fv)]
167    pub fn uniform_matrix_3fv(
168        this: &WebGL2RenderingContext,
169        location: &WebGLUniformLocation,
170        transpose: bool,
171        value: Vec<f32>,
172    );
173
174    /// The `WebGLRenderingContext.uniformMatrix[234]fv()` methods of the WebGL API specify matrix values for
175    /// uniform variables.
176    #[wasm_bindgen(method, js_name = uniformMatrix4fv)]
177    pub fn uniform_matrix_4fv(
178        this: &WebGL2RenderingContext,
179        location: &WebGLUniformLocation,
180        transpose: bool,
181        value: Vec<f32>,
182    );
183
184    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
185    #[wasm_bindgen(method, js_name = uniform1ui)]
186    pub fn uniform_1ui(this: &WebGL2RenderingContext, location: &WebGLUniformLocation, v0: u32);
187
188    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
189    #[wasm_bindgen(method, js_name = uniform2ui)]
190    pub fn uniform_2ui(
191        this: &WebGL2RenderingContext,
192        location: &WebGLUniformLocation,
193        v0: u32,
194        v1: u32,
195    );
196
197    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
198    #[wasm_bindgen(method, js_name = uniform3ui)]
199    pub fn uniform_3ui(
200        this: &WebGL2RenderingContext,
201        location: &WebGLUniformLocation,
202        v0: u32,
203        v1: u32,
204        v2: u32,
205    );
206
207    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
208    #[wasm_bindgen(method, js_name = uniform4ui)]
209    pub fn uniform_4ui(
210        this: &WebGL2RenderingContext,
211        location: &WebGLUniformLocation,
212        v0: u32,
213        v1: u32,
214        v2: u32,
215        v3: u32,
216    );
217
218    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
219    #[wasm_bindgen(method, js_name = uniform1uiv)]
220    pub fn uniform_1uiv(
221        this: &WebGL2RenderingContext,
222        location: &WebGLUniformLocation,
223        value: Vec<u32>,
224    );
225
226    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
227    #[wasm_bindgen(method, js_name = uniform2uiv)]
228    pub fn uniform_2uiv(
229        this: &WebGL2RenderingContext,
230        location: &WebGLUniformLocation,
231        value: Vec<u32>,
232    );
233
234    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
235    #[wasm_bindgen(method, js_name = uniform3uiv)]
236    pub fn uniform_3uiv(
237        this: &WebGL2RenderingContext,
238        location: &WebGLUniformLocation,
239        value: Vec<u32>,
240    );
241
242    /// The `WebGL2RenderingContext.uniform[1234][uif][v]()` methods of the WebGL API specify values of uniform variables.
243    #[wasm_bindgen(method, js_name = uniform4uiv)]
244    pub fn uniform_4uiv(
245        this: &WebGL2RenderingContext,
246        location: &WebGLUniformLocation,
247        value: Vec<u32>,
248    );
249
250    //TODO all uniform vector methods with optional srcoffset and srclength
251
252    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
253    /// uniform variables.
254    #[wasm_bindgen(method, js_name = uniformMatrix2x3fv)]
255    pub fn uniform_matrix_2x3fv(
256        this: &WebGL2RenderingContext,
257        location: &WebGLUniformLocation,
258        transpose: bool,
259        data: Vec<f32>,
260        srcOffset: u32,
261        srcLength: u32,
262    );
263
264    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
265    /// uniform variables.
266    #[wasm_bindgen(method, js_name = uniformMatrix2x4fv)]
267    pub fn uniform_matrix_2x4fv(
268        this: &WebGL2RenderingContext,
269        location: &WebGLUniformLocation,
270        transpose: bool,
271        data: Vec<f32>,
272        srcOffset: u32,
273        srcLength: u32,
274    );
275
276    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
277    /// uniform variables.
278    #[wasm_bindgen(method, js_name = uniformMatrix3x2fv)]
279    pub fn uniform_matrix_3x2fv(
280        this: &WebGL2RenderingContext,
281        location: &WebGLUniformLocation,
282        transpose: bool,
283        data: Vec<f32>,
284        srcOffset: u32,
285        srcLength: u32,
286    );
287
288    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
289    /// uniform variables.
290    #[wasm_bindgen(method, js_name = uniformMatrix3x4fv)]
291    pub fn uniform_matrix_3x4fv(
292        this: &WebGL2RenderingContext,
293        location: &WebGLUniformLocation,
294        transpose: bool,
295        data: Vec<f32>,
296        srcOffset: u32,
297        srcLength: u32,
298    );
299
300    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
301    /// uniform variables.
302    #[wasm_bindgen(method, js_name = uniformMatrix4x2fv)]
303    pub fn uniform_matrix_4x2fv(
304        this: &WebGL2RenderingContext,
305        location: &WebGLUniformLocation,
306        transpose: bool,
307        data: Vec<f32>,
308        srcOffset: u32,
309        srcLength: u32,
310    );
311
312    /// The `WebGL2RenderingContext.uniformMatrix[234]x[234]fv()` methods of the WebGL 2 API specify matrix values for
313    /// uniform variables.
314    #[wasm_bindgen(method, js_name = uniformMatrix4x3fv)]
315    pub fn uniform_matrix_4x3fv(
316        this: &WebGL2RenderingContext,
317        location: &WebGLUniformLocation,
318        transpose: bool,
319        data: Vec<f32>,
320        srcOffset: u32,
321        srcLength: u32,
322    );
323}