Struct cafe::render::render3D::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
24
25
26
27
28
29
30
31
32
33
34
    fn run(&mut self, dt: f32, render: &mut Self::Render) -> bool {
        render.begin();
        render.clear_color(Vec4::new(0.3, 0.4, 0.4, 1.0));
        render.clear();

        for pos in &self.positions {
            render.draw_cube(*pos);
        }

        render.end();
        true
    }
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
24
25
26
27
28
29
30
31
32
33
34
    fn run(&mut self, dt: f32, render: &mut Self::Render) -> bool {
        render.begin();
        render.clear_color(Vec4::new(0.3, 0.4, 0.4, 1.0));
        render.clear();

        for pos in &self.positions {
            render.draw_cube(*pos);
        }

        render.end();
        true
    }
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

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.