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
impl DrawContext
pub fn begin_frame(&mut self, graphics: &mut Graphics<Vertex>)
pub fn end_frame(&mut self)
pub fn shader(&self, reference: Option<&ShaderRef>) -> Option<Shader>
pub fn shader_or_pass(&self, reference: Option<&ShaderRef>) -> Option<Shader>
pub fn texture(&self, reference: Option<&TextureRef>) -> Option<Texture>
pub fn texture_or_empty( &self, reference: Option<&TextureRef>, ) -> Option<Texture>
pub fn pass_shader(&self) -> Option<Shader>
pub fn empty_texture(&self) -> Option<Texture>
pub fn fonts_texture(&self) -> Option<Texture>
pub fn push_shader(&mut self, shader: &ShaderRef)
pub fn pop_shader(&mut self) -> Option<Shader>
pub fn top_shader(&self) -> Option<Shader>
pub fn with_shader<R>(&mut self, shader: &ShaderRef, f: impl FnMut() -> R) -> R
pub fn push_transform(&mut self, transform: Transform<f32, f32, f32>)
pub fn pop_transform(&mut self) -> Option<Transform<f32, f32, f32>>
pub fn top_transform(&self) -> Transform<f32, f32, f32>
pub fn with_transform<R>( &mut self, transform: Transform<f32, f32, f32>, f: impl FnMut() -> R, ) -> R
pub fn push_blending(&mut self, blending: GlowBlending)
pub fn pop_blending(&mut self) -> Option<GlowBlending>
pub fn top_blending(&self) -> GlowBlending
pub fn with_blending<R>( &mut self, blending: GlowBlending, f: impl FnMut() -> R, ) -> R
Trait Implementations§
Source§impl Clone for DrawContext
impl Clone for DrawContext
Source§fn clone(&self) -> DrawContext
fn clone(&self) -> DrawContext
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for DrawContext
impl Default for DrawContext
Source§fn default() -> DrawContext
fn default() -> DrawContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DrawContext
impl !RefUnwindSafe for DrawContext
impl !Send for DrawContext
impl !Sync for DrawContext
impl Unpin for DrawContext
impl !UnwindSafe for DrawContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more