pub struct DrawContext {
    pub shaders: HashMap<Cow<'static, str>, Shader>,
    pub textures: HashMap<Cow<'static, str>, Texture>,
    pub fonts: FontMap,
    pub text_renderer: TextRenderer<Rgba<f32>>,
    /* private fields */
}

Fields§

§shaders: HashMap<Cow<'static, str>, Shader>§textures: HashMap<Cow<'static, str>, Texture>§fonts: FontMap§text_renderer: TextRenderer<Rgba<f32>>

Implementations§

source§

impl DrawContext

source

pub fn begin_frame(&mut self, graphics: &mut Graphics<Vertex>)

source

pub fn end_frame(&mut self)

source

pub fn shader(&self, reference: Option<&ShaderRef>) -> Option<Shader>

source

pub fn shader_or_pass(&self, reference: Option<&ShaderRef>) -> Option<Shader>

source

pub fn texture(&self, reference: Option<&TextureRef>) -> Option<Texture>

source

pub fn texture_or_empty( &self, reference: Option<&TextureRef> ) -> Option<Texture>

source

pub fn pass_shader(&self) -> Option<Shader>

source

pub fn empty_texture(&self) -> Option<Texture>

source

pub fn fonts_texture(&self) -> Option<Texture>

source

pub fn push_shader(&mut self, shader: &ShaderRef)

source

pub fn pop_shader(&mut self) -> Option<Shader>

source

pub fn top_shader(&self) -> Option<Shader>

source

pub fn with_shader<R>(&mut self, shader: &ShaderRef, f: impl FnMut() -> R) -> R

source

pub fn push_transform(&mut self, transform: Transform<f32, f32, f32>)

source

pub fn pop_transform(&mut self) -> Option<Transform<f32, f32, f32>>

source

pub fn top_transform(&self) -> Transform<f32, f32, f32>

source

pub fn with_transform<R>( &mut self, transform: Transform<f32, f32, f32>, f: impl FnMut() -> R ) -> R

source

pub fn push_blending(&mut self, blending: GlowBlending)

source

pub fn pop_blending(&mut self) -> Option<GlowBlending>

source

pub fn top_blending(&self) -> GlowBlending

source

pub fn with_blending<R>( &mut self, blending: GlowBlending, f: impl FnMut() -> R ) -> R

Trait Implementations§

source§

impl Clone for DrawContext

source§

fn clone(&self) -> DrawContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for DrawContext

source§

fn default() -> DrawContext

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

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.