Struct easy_imgui_renderer::Renderer
source · pub struct Renderer { /* private fields */ }
Expand description
The main Renderer
type.
Implementations§
source§impl Renderer
impl Renderer
sourcepub fn new(gl: GlContext) -> Result<Renderer>
pub fn new(gl: GlContext) -> Result<Renderer>
Creates a new renderer object.
You need to provide the OpenGL context yourself.
sourcepub fn gl_context(&self) -> &GlContext
pub fn gl_context(&self) -> &GlContext
Gets a reference to the OpenGL context.
sourcepub fn set_background_color(&mut self, color: Option<Color>)
pub fn set_background_color(&mut self, color: Option<Color>)
Sets the default background color.
The set color will be used for glClear(GL_COLOR_BUFFER_BIT)
.
Set to None
to avoid this, and use easy_imgui::UiBuilder::pre_render
to do whatever clearing
you need, if anything.
sourcepub fn background_color(&self) -> Option<Color>
pub fn background_color(&self) -> Option<Color>
Gets the background color.
sourcepub fn set_size(&mut self, size: Vector2, scale: f32)
pub fn set_size(&mut self, size: Vector2, scale: f32)
Sets the UI size, in logical units, and the scale factor.
sourcepub fn do_frame<A: UiBuilder>(&mut self, app: &mut A)
pub fn do_frame<A: UiBuilder>(&mut self, app: &mut A)
Builds and renders a UI frame, using the app
easy_imgui::UiBuilder
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Renderer
impl !Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl !UnwindSafe for Renderer
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