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 with_builder(gl: GlContext, builder: &ContextBuilder) -> Result<Renderer>
pub fn with_builder(gl: GlContext, builder: &ContextBuilder) -> Result<Renderer>
Creates a new renderer object.
Just like new() but you can specify context parameters.
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.
Sourcepub fn unmap_tex(tex: TextureId) -> Option<Texture>
pub fn unmap_tex(tex: TextureId) -> Option<Texture>
Gets an OpenGL texture from an ImGui texture.
Sourcepub fn delete_tex(tex: TextureId) -> Option<Texture>
pub fn delete_tex(tex: TextureId) -> Option<Texture>
Deletes an OpenGL texture from the texture map.
Returns the native texture, if any.
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more