{"version":3,"file":"RenderTexture.mjs","sources":["../../../../../src/rendering/renderers/shared/texture/RenderTexture.ts"],"sourcesContent":["import { TextureSource } from './sources/TextureSource';\nimport { Texture } from './Texture';\n\nimport type { TextureSourceOptions } from './sources/TextureSource';\n\n/**\n * A render texture, extends `Texture`.\n * @see {@link Texture}\n * @category rendering\n * @advanced\n */\nexport class RenderTexture extends Texture\n{\n    /**\n     * Creates a RenderTexture. Pass `dynamic: true` in options to allow resizing after creation.\n     * @param options - Options for the RenderTexture, including width, height, and dynamic.\n     * @returns A new RenderTexture instance.\n     * @example\n     * const rt = RenderTexture.create({ width: 100, height: 100, dynamic: true });\n     * rt.resize(500, 500);\n     */\n    public static create(options: TextureSourceOptions): RenderTexture\n    {\n        // Pass dynamic to the RenderTexture constructor if present in options\n        const { dynamic, ...rest } = options;\n\n        return new RenderTexture({\n            source: new TextureSource(rest),\n            dynamic: dynamic ?? false,\n        });\n    }\n\n    /**\n     * Resizes the render texture.\n     * @param width - The new width of the render texture.\n     * @param height - The new height of the render texture.\n     * @param resolution - The new resolution of the render texture.\n     * @returns This texture.\n     */\n    public resize(width: number, height: number, resolution?: number): this\n    {\n        this.source.resize(width, height, resolution);\n\n        return this;\n    }\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,sBAAsB,OAAA,CACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,OAAc,OAAO,OAAA,EACrB;AAEI,IAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAK,GAAI,OAAA;AAE7B,IAAA,OAAO,IAAI,aAAA,CAAc;AAAA,MACrB,MAAA,EAAQ,IAAI,aAAA,CAAc,IAAI,CAAA;AAAA,MAC9B,SAAS,OAAA,IAAW;AAAA,KACvB,CAAA;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,MAAA,CAAO,KAAA,EAAe,MAAA,EAAgB,UAAA,EAC7C;AACI,IAAA,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,MAAA,EAAQ,UAAU,CAAA;AAE5C,IAAA,OAAO,IAAA;AAAA,EACX;AACJ;;;;"}