pub(crate) struct Binder {
    pub(crate) vbo: u32,
    pub(crate) vao: u32,
    pub(crate) ebo: u32,
    pub(crate) texture: u32,
}
Expand description

General Information

Variables asocciated with GPU and drawable object(s). Assigned by OpenGL. Should always be mutable.

Fields

  • vbo (Vertex Buffer Object) - Vertices Generated by Mesh.
  • vao (Vertex Array Object) - Binds vertices and it’s configuration with OpenGL.
  • ebo (Element Buffer Object) - Indices to draw vertices.
  • texture - Texture in 2D to use over object to draw.

Fields§

§vbo: u32§vao: u32§ebo: u32§texture: u32

Implementations§

Simple new function. Generates new instance of Binder.

General Information

sets up binder’s variables with GPU. Should always be used after instance of window has set up OpenGL context. Never binds texture.

Parameters
  • &mut self - OpenGL changes the values of instance fields effectively setting up linkage beetween vao and vbo and ebo. Texture has to be set up later since not all drawings have it.
General Information

Binds binder’s vao to use.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.
General Information

Binds binder’s vbo to use.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.
General Information

Binds binder’s ebo to use.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.
General Information

Binds vao, ebo and vbo. Never binds texture.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.
General Information

Binds a 2D texture providing a standar way to scale up and down (mipmap), and enabling blending so that alpha channel is respected. When enabling blending, it’s necessary to change how it occurs: If alpha channel is to be respected, the incoming pixels have to be alpha transparent, while the pixes already present have to be (1-alpha) transparent.

Parameters
  • &mut self - OpenGL changes values of instance field texture effectively linking current texture to use.
General Information

Binds binder’s texture to use.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.
General information

Unbind texture when needed. Since not all objects posess a texture, this has to be done sometimes.

General Information

Binds vao, ebo, vbo and texture.

Parameters
  • &self - Instance does not need to be mutable since it’s already setup.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.