Struct ggez::graphics::MeshBatch[][src]

pub struct MeshBatch { /* fields omitted */ }
Expand description

Mesh that will be rendered with hardware instancing. Use this when you have a lot of similar geometry which does not move around often.

Implementations

Creates a new mesh batch.

Takes ownership of the Mesh.

Removes all instances from the batch.

Calling this invalidates the entire buffer, however this will not automatically deallocate graphics card memory or flush the buffer.

Returns a reference to mesh instances

Returns a mutable reference to mesh instances.

Please note that manually altering items in this slice will not automatically invalidate the buffer, you will have to manually call flush() or flush_range() later.

Adds a new instance to the mesh batch

Returns a handle with which to modify the instance using set()

Calling this invalidates the entire buffer and will result in flusing it on the next graphics::draw() call.

Alters an instance in the batch to use the given draw params.

Calling this invalidates the entire buffer and will result in flusing it on the next graphics::draw() call.

This might cause performance issues with large batches, to avoid this consider using flush_range to explicitly invalidate required data slice.

Alters a range of instances in the batch to use the given draw params

Calling this invalidates the entire buffer and will result in flusing it on the next graphics::draw() call.

This might cause performance issues with large batches, to avoid this consider using flush_range to explicitly invalidate required data slice.

Immediately sends specified slice of data in the batch to the graphics card.

Calling this counts as a full buffer flush, but only flushes the data within the provided range, anything outside of this range will not be touched.

Use it for updating small portions of large batches.

Immediately sends all data in the batch to the graphics card.

In general, graphics::draw() on the MeshBatch will do this automatically when buffer contents are updated.

Draws the drawable onto the rendering target.

Returns a bounding box in the form of a Rect.

Sets the blend mode to be used when drawing this drawable.

Gets the blend mode to be used when drawing this drawable.

Trait Implementations

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

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.