/** * @import RenderTarget from "./rendertarget.ts"; */ /** * Manages a pool of {@link RenderTarget} instances for post-effect processing. * Renderer-agnostic — the actual RenderTarget creation is delegated to a * factory function provided by the renderer (WebGL, WebGPU, etc.). * * Camera effects use pool indices 0 and 1 (capture + ping-pong), * sprite effects use indices 2 and 3. * Render targets are lazily created and resized to match the required dimensions. * @ignore */ export default class RenderTargetPool { /** * @param {function(number, number): RenderTarget} factory - creates a RenderTarget with the given width and height */ constructor(factory: (arg0: number, arg1: number) => RenderTarget); /** @type {function(number, number): RenderTarget} */ _factory: (arg0: number, arg1: number) => RenderTarget; /** @type {RenderTarget[]} */ _pool: RenderTarget[]; /** @type {number} */ _activeBase: number; /** @type {number} */ _previousBase: number; /** * Get or create a render target at the given pool index, resized to the given dimensions. * @param {number} index - pool index * @param {number} width - desired width in pixels * @param {number} height - desired height in pixels * @returns {RenderTarget} the render target */ get(index: number, width: number, height: number): RenderTarget; /** * Prepare render targets for a post-effect pass. * Allocates/resizes the capture target and optionally the ping-pong target. * @param {boolean} isCamera - true for camera effects (indices 0+1), false for sprite (indices 2+3) * @param {number} effectCount - number of enabled effects * @param {number} width - target width in pixels * @param {number} height - target height in pixels * @returns {RenderTarget} the capture target (ready to bind) */ begin(isCamera: boolean, effectCount: number, width: number, height: number): RenderTarget; /** * Get the capture render target for the current active pass. * @returns {RenderTarget|undefined} the capture target, or undefined if no active pass */ getCaptureTarget(): RenderTarget | undefined; /** * Get the ping-pong render target for the current active pass. * @returns {RenderTarget|undefined} the ping-pong target, or undefined if no active pass */ getPingPongTarget(): RenderTarget | undefined; /** * End the current pass and restore the previous active base. * Returns the parent render target to rebind (or null for screen). * @returns {RenderTarget|null} the parent target, or null if returning to screen */ end(): RenderTarget | null; /** * Resize all existing render targets in the pool to the given dimensions. * @param {number} width - new width in pixels * @param {number} height - new height in pixels */ resizeAll(width: number, height: number): void; /** * Destroy all render targets and clear the pool. */ destroy(): void; } import type RenderTarget from "./rendertarget.ts"; //# sourceMappingURL=render_target_pool.d.ts.map