1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::internal::*;
use crate::texture::*;
use crate::*;
pub struct Immediate {}
impl Immediate {
pub fn draw<'t>(
texture: &'t Texture,
position: Vector2,
srcRectangle: Option<Rectangle>,
rotationInRadians: f32,
origin: Option<Vector2>,
scale: Option<Vector2>,
color: Color,
flip: SpriteFlip,
) -> CallResult {
unsafe {
wrap_result(BLZ_DrawImmediate(
texture.raw,
position.into(),
srcRectangle.map(|r| r.into()).as_raw(),
rotationInRadians,
origin.map(|v| v.into()).as_raw(),
scale.map(|v| v.into()).as_raw(),
color.into(),
flip as u32,
))
}
}
pub fn lower_draw<'t>(texture: &'t Texture, quad: &SpriteQuad) -> CallResult {
let q: BLZ_SpriteQuad = quad.into();
unsafe { wrap_result(BLZ_LowerDrawImmediate(texture.id, &q)) }
}
}