Trait adi_gpu_base::Display [−][src]
pub trait Display { fn color(&mut self, color: (f32, f32, f32)); fn fog(&mut self, fog: Option<(f32, f32)>); fn update(&mut self) -> Option<Input>; fn camera(&mut self, position: Vec3, rotation: Vec3); fn model(&mut self, vertices: &[f32], fans: Vec<(u32, u32)>) -> Model; fn texture(&mut self, wh: (u16, u16), graphic: &VFrame) -> Texture; fn gradient(&mut self, colors: &[f32]) -> Gradient; fn texcoords(&mut self, texcoords: &[f32]) -> TexCoords; fn set_texture(
&mut self,
texture: &mut Texture,
wh: (u16, u16),
graphic: &VFrame
); fn shape_solid(
&mut self,
model: &Model,
transform: Transform,
color: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape; fn shape_gradient(
&mut self,
model: &Model,
transform: Transform,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape; fn shape_texture(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
blending: bool,
fog: bool,
camera: bool
) -> Shape; fn shape_faded(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
alpha: f32,
fog: bool,
camera: bool
) -> Shape; fn shape_tinted(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
tint: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape; fn shape_complex(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape; fn drop_shape(&mut self, shape: &Shape); fn transform(&mut self, shape: &Shape, transform: Transform); fn resize(&mut self, wh: (u16, u16)); fn wh(&self) -> (u16, u16); }
A trait for a Display
Required Methods
fn color(&mut self, color: (f32, f32, f32))
Set the background color for the Display
.
color
: The background color for the display.
fn fog(&mut self, fog: Option<(f32, f32)>)
Set the fog for the display.
fog
:None
for no fog, otherwise set fog begin distance and fog end distance.
fn update(&mut self) -> Option<Input>
Get input, if there's any. If there's no input, update the
Display
and return None
.
fn camera(&mut self, position: Vec3, rotation: Vec3)
Move the camera.
position
: position of the camera.rotation
: rotation of the camera.
fn model(&mut self, vertices: &[f32], fans: Vec<(u32, u32)>) -> Model
Create a new Model
for this Display
.
fn texture(&mut self, wh: (u16, u16), graphic: &VFrame) -> Texture
Create a new Texture
for this Display
.
fn gradient(&mut self, colors: &[f32]) -> Gradient
Create a new Gradient
for this Display
.
fn texcoords(&mut self, texcoords: &[f32]) -> TexCoords
Create new TexCoords
for this Display
.
fn set_texture(
&mut self,
texture: &mut Texture,
wh: (u16, u16),
graphic: &VFrame
)
&mut self,
texture: &mut Texture,
wh: (u16, u16),
graphic: &VFrame
)
Set the pixels for a Texture
.
fn shape_solid(
&mut self,
model: &Model,
transform: Transform,
color: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
color: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
Create a new shape with a solid color.
fn shape_gradient(
&mut self,
model: &Model,
transform: Transform,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Create a new shape shaded by a gradient (1 color per vertex).
fn shape_texture(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
blending: bool,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Create a new shape shaded by a texture using texture coordinates.
Texture Coordinates follow this format (X, Y, UNUSED(1.0), ALPHA)
fn shape_faded(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
alpha: f32,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
alpha: f32,
fog: bool,
camera: bool
) -> Shape
Create a new shape shaded by a texture using texture coordinates and alpha.
Texture Coordinates follow this format (X, Y, UNUSED(1.0), ALPHA)
fn shape_tinted(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
tint: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
tint: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
Create a new shape shaded by a texture using texture coordinates and tint.
Texture Coordinates follow this format (X, Y, UNUSED(1.0), ALPHA)
fn shape_complex(
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
&mut self,
model: &Model,
transform: Transform,
texture: &Texture,
tc: TexCoords,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Create a new shape shaded by a texture using texture coordinates and tint per vertex.
Texture Coordinates follow this format (X, Y, UNUSED(1.0), ALPHA)
fn drop_shape(&mut self, shape: &Shape)
Drop a shape (don't draw it anymore).
fn transform(&mut self, shape: &Shape, transform: Transform)
Transform the shape.
fn resize(&mut self, wh: (u16, u16))
Resize the display.
fn wh(&self) -> (u16, u16)
Get the width and height of the window, as a tuple.