LogoPixi’VN
pixi-jsFunctions

Function: ensureIsBuffer()

> ensureIsBuffer(buffer, index): Buffer

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/ensureIsBuffer.d.ts:13

Internal

Converts something into a buffer. If it is already a buffer it will pass it through if it is a number array it will convert it to a float32 array before being passed into a buffer the buffer will be created with the correct usage flags for geometry attributes

Parameters

buffer

number[] | Buffer | TypedArray

number array

index

boolean

is this an index buffer?

Returns

Buffer

a buffer