Render3D

Struct Render3D 

Source
pub struct Render3D { /* private fields */ }

Implementations§

Source§

impl Render3D

Source

pub fn clear_color(&mut self, color: Vec4)

Examples found in repository?
examples/cube.rs (line 25)
23    fn run(&mut self, dt: f32, render: &mut Self::Render) -> bool {
24        render.begin();
25        render.clear_color(Vec4::new(0.3, 0.4, 0.4, 1.0));
26        render.clear();
27
28        for pos in &self.positions {
29            render.draw_cube(*pos);
30        }
31
32        render.end();
33        true
34    }
Source

pub fn setup(&mut self)

Source

pub fn white_texture(&mut self)

Source

pub fn draw_plane(&mut self, pos: Vec3)

Source

pub fn draw_cube(&mut self, pos: Vec3)

Examples found in repository?
examples/cube.rs (line 29)
23    fn run(&mut self, dt: f32, render: &mut Self::Render) -> bool {
24        render.begin();
25        render.clear_color(Vec4::new(0.3, 0.4, 0.4, 1.0));
26        render.clear();
27
28        for pos in &self.positions {
29            render.draw_cube(*pos);
30        }
31
32        render.end();
33        true
34    }
Source

pub fn draw(&self)

Trait Implementations§

Source§

impl Debug for Render3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Render3D

Source§

fn default() -> Render3D

Returns the “default value” for a type. Read more
Source§

impl Render for Render3D

Source§

type Effect = Effect3D

Source§

fn new() -> Self

Source§

fn clear(&self)

Source§

fn camera(&mut self) -> &mut dyn Camera

Source§

fn begin(&mut self)

Source§

fn end(&self)

Source§

fn set_canvas(&mut self, canvas: Option<&Canvas>)

Source§

fn set_effect(&mut self, effect: Option<&Self::Effect>)

Source§

fn on_resize(&mut self, width: i32, height: i32)

Source§

fn clear_color(&self, color: Vec4)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.