Renderer · function

createMeshInstances

Allocate both arrays at capacity, empty.

Explained in Hello world.

function createMeshInstances(capacity: number): MeshInstances
import { createMeshInstances } from '@driftengine/core';

Parameters

ParameterTypeDescription
capacitynumber

In depth

Allocated once and rewritten in place, never per frame — the arrays are the caller's to fill and the count is the caller's to set, which is what keeps a frame that redraws a batch allocation-free.