pub struct AutoRenderer { /* private fields */ }
Expand description
Renderer which owns the OpenGL context and handles textures itself. Also
converts all output colors to sRGB for display. Useful for simple applications,
but more complicated applications may prefer to use Renderer
, or even
write their own renderer based on this code.
OpenGL context is still available to the rest of the application through
the gl_context
method.
Implementations§
Source§impl AutoRenderer
impl AutoRenderer
Sourcepub fn new(
gl: Context,
imgui_context: &mut ImGuiContext,
) -> Result<Self, InitError>
pub fn new( gl: Context, imgui_context: &mut ImGuiContext, ) -> Result<Self, InitError>
Creates a new AutoRenderer
for simple rendering.
§Errors
Any error initialising the OpenGL objects (including shaders) will result in an error.
Sourcepub fn initialize(
gl: Context,
imgui_context: &mut ImGuiContext,
) -> Result<Self, InitError>
👎Deprecated since 0.13.0: use new
instead
pub fn initialize( gl: Context, imgui_context: &mut ImGuiContext, ) -> Result<Self, InitError>
new
insteadCreates a new AutoRenderer
for simple rendering.
Sourcepub fn gl_context(&self) -> &Rc<Context>
pub fn gl_context(&self) -> &Rc<Context>
Note: no need to provide a mut
version of this, as all methods on
glow::HasContext
are immutable.
pub fn texture_map(&self) -> &SimpleTextureMap
pub fn texture_map_mut(&mut self) -> &mut SimpleTextureMap
pub fn renderer(&self) -> &Renderer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoRenderer
impl RefUnwindSafe for AutoRenderer
impl !Send for AutoRenderer
impl !Sync for AutoRenderer
impl Unpin for AutoRenderer
impl UnwindSafe for AutoRenderer
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