pub trait Bind {
    fn bind(&self, gl: &GL);

    fn unbind(&self, _gl: &GL) { ... }
}
Expand description

The Bind trait enables setting up WebGl state when bound, and optionally resetting to a neutral one when unbound.

These functons should be implented without mutating the implementing struct, i.e. just changing the state of the WebGl2RenderingContext.

Required Methods

Binds a struct implementing the Bind trait. This is up to the implementation to decide.

Provided Methods

Optionally unbinds a struct implementing the Bind trait. This effectively resets the WebGL state.

Implementors