import MeshSubset from "../utils/MeshSubset"; import RenderState from "./RenderState"; import BatchToken from "./BatchToken"; import MeshBatch from "../display/MeshBatch"; import Mesh from "../display/Mesh"; declare namespace starling.rendering { /** * This class manages a list of mesh batches of different types; * * it acts as a "meta" MeshBatch that initiates all rendering. * */ export class BatchProcessor { /** * Creates a new batch processor. */ constructor(onBatchComplete: (arg0: MeshBatch) => void); /** * Disposes all batches (including those in the reusable pool). */ dispose(): void; /** * Adds a mesh to the current batch, or to a new one if the current one does not support * * it. Whenever the batch changes, onBatchComplete is called for the previous * * one. * * * * @param mesh the mesh to add to the current (or new) batch. * * @param state the render state from which to take the current settings for alpha, * * modelview matrix, and blend mode. * * @param subset the subset of the mesh you want to add, or null for * * the complete mesh. * * @param ignoreTransformations when enabled, the mesh's vertices will be added * * without transforming them in any way (no matter the value of the * * state's modelviewMatrix). * */ addMesh(mesh: Mesh, state: RenderState, subset?: MeshSubset, ignoreTransformations?: boolean): void; /** * Finishes the current batch, i.e. call the 'onComplete' callback on the batch and * * prepares initialization of a new one. */ finishBatch(): void; /** * Calls 'finishBatch()' and sets 'frameFinished' to true. */ finishFrame(): void; /** * Clears all batches and adds them to a pool so they can be reused later. */ clear(): void; /** * Returns the batch at a certain index. */ getBatchAt(batchID: number): MeshBatch; /** * Disposes all batches that are currently unused. */ trim(): void; /** * Sets all properties of the given token so that it describes the current position * * within this instance. */ fillToken(token: BatchToken): BatchToken; /** * The number of batches currently stored in the BatchProcessor. */ get numBatches(): number; /** * Indicates if the processed frame is complete, i.e. 'finishFrame()' has been called. */ get frameFinished(): boolean; /** * This callback is executed whenever a batch is finished and replaced by a new one. * * The finished MeshBatch is passed to the callback. Typically, this callback is used * * to actually render it. */ get onBatchComplete(): (arg0: MeshBatch) => void; set onBatchComplete(value: (arg0: MeshBatch) => void) } } export default starling.rendering.BatchProcessor;