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 set_matrix(&mut self, matrix: Option<Matrix3<f32>>)
pub fn set_matrix(&mut self, matrix: Option<Matrix3<f32>>)
Sets the 2D (3x3) matrix transformation for the UI display.
If you set this matrix to Some
then it is your responsibility to also call the appropriate gl.viewport()
.
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 Freeze for Renderer
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