UNPKG

@tolokoban/tgd

Version:

ToloGameDev library for WebGL2

85 lines 2.73 kB
import { TgdPainterFunction } from "../types/painter"; import { TgdContext } from "../context"; import { TgdPainterGroup } from "./group"; import { TgdPainter } from "./painter"; import { TgdTexture2D } from "../texture"; export interface TgdPainterFramebufferWithAntiAliasingOptions { /** * Default to 4. */ samples?: number; /** * Do we need a depth buffer? * Default to `true`. */ depthBuffer: boolean; /** * Do we need a stencil buffer? * Default to `true`. */ stencilBuffer: boolean; /** * If defined, the framebuffer will automatically match the * current viewport size multiplied by `viewportMatchingScale`. * * for instance, if `viewportMatchingScale === 0.5` and the viewport * id (640, 480), then the framebuffer will have a size of * (320, 240). * * Default to `1`. */ viewportMatchingScale?: number; textureColor0?: TgdTexture2D; textureColor1?: TgdTexture2D; textureColor2?: TgdTexture2D; textureColor3?: TgdTexture2D; textureDepth?: TgdTexture2D; /** * Function to execute before painting. */ onEnter?: TgdPainterFunction; /** * Function to execute after painting. */ onExit?: TgdPainterFunction; children?: TgdPainter[]; } export declare class TgdPainterFramebufferWithAntiAliasing extends TgdPainterGroup { private readonly context; private readonly options; readonly samples: number; readonly textureColor0: TgdTexture2D | undefined; readonly textureColor1: TgdTexture2D | undefined; readonly textureColor2: TgdTexture2D | undefined; readonly textureColor3: TgdTexture2D | undefined; readonly textureDepth: TgdTexture2D | undefined; private colorRenderbuffersMSAA; private _depthBufferMSAA; private _framebufferMSAA; /** * The framebuffer becomes dirty as soon as the width or height changes. */ private dirty; private _width; private _height; private _framebuffer; private _depthBuffer; private _stencilBuffer; private readonly drawBuffers; constructor(context: TgdContext, options: Partial<TgdPainterFramebufferWithAntiAliasingOptions>); get width(): number; private set width(value); get height(): number; private set height(value); private updateTextureForColor; private createDepthBufferMSAA; private createStencilBuffer; private createFramebufferMSAA; private createFramebufferIfNeeded; private blitFramebuffers; paint(time: number, delay: number): void; delete(): void; private deleteRenderbuffersMSAA; private createRenderbuffersMSAA; } //# sourceMappingURL=framebuffer-msaa.d.ts.map