pub enum DrawCommand {
Clear {
color: Color,
},
DrawCircle {
x: f32,
y: f32,
radius: f32,
color: Color,
},
DrawRect {
x: f32,
y: f32,
w: f32,
h: f32,
color: Color,
},
DrawLine {
x1: f32,
y1: f32,
x2: f32,
y2: f32,
thickness: f32,
color: Color,
},
DrawText {
text: String,
x: f32,
y: f32,
size: f32,
color: Color,
},
SetCamera {
camera: Camera,
},
DrawTriangle {
x1: f32,
y1: f32,
x2: f32,
y2: f32,
x3: f32,
y3: f32,
color: Color,
},
DrawPoly {
points: Vec<Vec2>,
color: Color,
},
DrawEllipse {
x: f32,
y: f32,
rx: f32,
ry: f32,
color: Color,
},
DrawRing {
x: f32,
y: f32,
inner_radius: f32,
outer_radius: f32,
color: Color,
},
DrawArc {
x: f32,
y: f32,
radius: f32,
start_angle: f32,
end_angle: f32,
color: Color,
},
}Expand description
Drawing operations that the game can issue each frame.
In the real rendering backend, these would be batched and sent to the GPU. For the API definition, we store the draw commands for deferred rendering.
Variants§
Clear
DrawCircle
DrawRect
DrawLine
DrawText
SetCamera
DrawTriangle
DrawPoly
DrawEllipse
DrawRing
DrawArc
Trait Implementations§
Source§impl Clone for DrawCommand
impl Clone for DrawCommand
Source§fn clone(&self) -> DrawCommand
fn clone(&self) -> DrawCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DrawCommand
impl RefUnwindSafe for DrawCommand
impl Send for DrawCommand
impl Sync for DrawCommand
impl Unpin for DrawCommand
impl UnsafeUnpin for DrawCommand
impl UnwindSafe for DrawCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more