Struct OpenglRenderer

Source
pub struct OpenglRenderer {
    pub camera: Camera,
    pub viewport: UVec2,
    /* private fields */
}

Fields§

§camera: Camera§viewport: UVec2

Implementations§

Source§

impl OpenglRenderer

Source

pub fn new(gl: Context) -> Result<Self, OpenglRendererError>

Source

pub fn set_blend_mode(&self, blend_mode: BlendMode)

Set blending mode. See BlendMode for supported blend modes.

Source

pub fn clear_texture_cache(&self)

Clear the texture cache This one method missing made me pull my hair out for an entire month.

Trait Implementations§

Source§

impl InoxRenderer for OpenglRenderer

Source§

type Error = OpenglRendererError

Source§

fn prepare(&mut self, model: &Model) -> Result<(), Self::Error>

For any model-specific setup, e.g. creating buffers with specific sizes. Read more
Source§

fn resize(&mut self, w: u32, h: u32)

Resize the renderer’s viewport.
Source§

fn clear(&self)

Clear the canvas.
Source§

fn on_begin_scene(&self)

Initiate one render pass.
Source§

fn render(&self, puppet: &Puppet)

The render pass. Read more
Source§

fn on_end_scene(&self)

Finish one render pass.
Source§

fn draw_scene(&self)

Actually make results visible, e.g. on a screen/texture.
Source§

fn on_begin_mask(&self, has_mask: bool)

Begin masking. Read more
Source§

fn set_mask_mode(&self, dodge: bool)

The following draw calls consist of a mask or dodge mask.
Source§

fn on_begin_masked_content(&self)

Read only from the stencil buffer, unlock the color buffer.
Source§

fn on_end_mask(&self)

Disable the stencil buffer.
Source§

fn draw_mesh_self(&self, _as_mask: bool, _camera: &Mat4)

Draw contents of a mesh-defined plain region.
Source§

fn draw_part_self( &self, as_mask: bool, camera: &Mat4, node_render_ctx: &NodeRenderCtx, part: &Part, part_render_ctx: &PartRenderCtx, )

Draw contents of a part.
Source§

fn begin_composite_content(&self)

When something needs to happen before drawing to the composite buffers.
Source§

fn finish_composite_content(&self, as_mask: bool, composite: &Composite)

Transfer content from composite buffers to normal buffers.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InoxRendererCommon for T
where T: InoxRenderer,

Source§

fn draw_part( &self, camera: &Mat4, node_render_ctx: &NodeRenderCtx, part: &Part, part_render_ctx: &PartRenderCtx, puppet: &Puppet, )

Draw one part, with its content properly masked.
Source§

fn draw_composite( &self, as_mask: bool, camera: &Mat4, comp: &Composite, puppet: &Puppet, children: &[InoxNodeUuid], )

Draw one composite.
Source§

fn draw(&self, camera: &Mat4, puppet: &Puppet)

Iterate over top-level drawables (excluding masks) in zsort order, and make draw calls correspondingly. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more