zeros
On this page

zeros()

Function in Runtime

A storage array of length zeroed structs of cls, a class a shader module exports: one range of the region.

import { zeros } from 'typeshade/runtime'

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

function zeros<T extends object>(cls: ResourceClass<T, 'set'>, length: number): Buffer<T>

Parameters

cls ResourceClass<T, 'set'>
length number

how many elements, a whole number.

Return value

Buffer<T>

the array, whose element i is set as ps.at(i).pos.set(…).

Exceptions

TypeError

TypeError for a value that is no class of a shader module, for an abstract class, for a struct with no storage layout, for a field named set, which the host’s editor refuses already with TS8079 (Amendment A5, D3), and for a length that is not a whole number.

Source

src/runtime/resource.ts, line 1034, at commit af54ddad5

Edit this page Report a problem