pub struct Screen<Ctx> where
Ctx: Default, {
pub ctx: Ctx,
/* private fields */
}
Expand description
A Window to the Screen.
Fields
ctx: Ctx
Implementations
sourceimpl<Ctx> Screen<Ctx> where
Ctx: Default,
impl<Ctx> Screen<Ctx> where
Ctx: Default,
sourcepub fn start(
run: fn(_: &mut Screen<Ctx>, _: Event, _: f32)
) -> Result<(), ScreenError>
pub fn start(
run: fn(_: &mut Screen<Ctx>, _: Event, _: f32)
) -> Result<(), ScreenError>
Start the program.
sourcepub fn switch(&mut self, run: fn(_: &mut Screen<Ctx>, _: Event, _: f32))
pub fn switch(&mut self, run: fn(_: &mut Screen<Ctx>, _: Event, _: f32))
Switch the run function
sourcepub fn model(&mut self, vertices: &[f32], fans: Vec<(u32, u32)>) -> Model
pub fn model(&mut self, vertices: &[f32], fans: Vec<(u32, u32)>) -> Model
Upload a model to the GPU.
sourcepub fn texture(&mut self, wh: (u16, u16), graphic: &VFrame) -> Texture
pub fn texture(&mut self, wh: (u16, u16), graphic: &VFrame) -> Texture
Upload a texture to the GPU.
sourcepub fn texcoords(&mut self, texcoords: &[(f32, f32)]) -> TexCoords
pub fn texcoords(&mut self, texcoords: &[(f32, f32)]) -> TexCoords
Create texture coordinate object.
sourcepub fn set_texture(
&mut self,
texture: &mut Texture,
wh: (u16, u16),
graphic: &VFrame
)
pub fn set_texture(
&mut self,
texture: &mut Texture,
wh: (u16, u16),
graphic: &VFrame
)
Set the pixels of a texture to something other than the original.
sourcepub fn shape_solid(
&mut self,
model: &Model,
matrix: Matrix,
color: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
pub fn shape_solid(
&mut self,
model: &Model,
matrix: Matrix,
color: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
Make a shape with solid color.
sourcepub fn shape_gradient(
&mut self,
model: &Model,
matrix: Matrix,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
pub fn shape_gradient(
&mut self,
model: &Model,
matrix: Matrix,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Make a shape with gradient
sourcepub fn shape_texture(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
blending: bool,
fog: bool,
camera: bool
) -> Shape
pub fn shape_texture(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Make a shape will solid texture.
sourcepub fn shape_faded(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
alpha: f32,
fog: bool,
camera: bool
) -> Shape
pub fn shape_faded(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
alpha: f32,
fog: bool,
camera: bool
) -> Shape
Make a shape will texture and transparency
sourcepub fn shape_tinted(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
tint: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
pub fn shape_tinted(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
tint: [f32; 4],
blending: bool,
fog: bool,
camera: bool
) -> Shape
Make a shape with texture, and tint (color)
sourcepub fn shape_complex(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
pub fn shape_complex(
&mut self,
model: &Model,
matrix: Matrix,
texture: &Texture,
tc: TexCoords,
gradient: Gradient,
blending: bool,
fog: bool,
camera: bool
) -> Shape
Make a shape with texture, and gradent
sourcepub fn drop_shape(&mut self, shape: &Shape)
pub fn drop_shape(&mut self, shape: &Shape)
Stop drawing a shape.
Auto Trait Implementations
impl<Ctx> !RefUnwindSafe for Screen<Ctx>
impl<Ctx> !Send for Screen<Ctx>
impl<Ctx> !Sync for Screen<Ctx>
impl<Ctx> Unpin for Screen<Ctx> where
Ctx: Unpin,
impl<Ctx> !UnwindSafe for Screen<Ctx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more