@itwin/core-frontend
Version:
iTwin.js frontend components
72 lines • 3.02 kB
TypeScript
/** @packageDocumentation
* @module WebGL
*/
import { WebGLDisposable } from "./Disposable";
import { GL } from "./GL";
import { RenderBuffer, RenderBufferMultiSample } from "./RenderBuffer";
import { TextureHandle } from "./Texture";
/** @internal */
export type DepthBuffer = RenderBuffer | RenderBufferMultiSample | TextureHandle;
/** @internal */
export declare const enum FrameBufferBindState {
Unbound = 0,
Bound = 1,
BoundWithAttachments = 2,
BoundMultisampled = 3,
BoundWithAttachmentsMultisampled = 4,
Suspended = 5
}
/** @internal */
export declare class FrameBuffer implements WebGLDisposable {
private _fbo?;
private _fboMs?;
private _bindState;
private readonly _colorTextures;
private readonly _colorMsBuffers;
private readonly _colorAttachments;
private readonly _colorMsFilters;
readonly depthBuffer?: DepthBuffer;
readonly depthBufferMs?: DepthBuffer;
get isDisposed(): boolean;
get isBound(): boolean;
get isBoundMultisampled(): boolean;
get isSuspended(): boolean;
get isMultisampled(): boolean;
getColor(ndx: number): TextureHandle;
getColorTargets(useMSBuffers: boolean, ndx: number): {
tex: TextureHandle;
msBuf: RenderBufferMultiSample | undefined;
};
private constructor();
static create(colorTextures: TextureHandle[], depthBuffer?: DepthBuffer, colorMsBuffers?: RenderBufferMultiSample[], msFilters?: GL.MultiSampling.Filter[], depthBufferMs?: DepthBuffer): FrameBuffer | undefined;
[Symbol.dispose](): void;
bind(bindAttachments?: boolean, bindMS?: boolean): boolean;
unbind(): void;
suspend(): void;
markTargetsDirty(): void;
/** blitDepth is true to blit the depth/stencil buffer. ndx is index of single attachment to blit.
* All color attachments are blitted if ndx is undefined, none are blitted if ndx is -1.
*/
blitMsBuffersToTextures(blitDepth: boolean, ndx?: number): void;
/** invDepth is true to invalidate depth buffer. invStencil is true to invalidate stencil buffer. ndx is index of single color attachment to invalidate.
* All color attachments are invalidated if ndx is undefined, none are invalidated if ndx is -1.
* Set withMultiSampling to true to invalidate the MS buffers.
*/
invalidate(invDepth: boolean, invStencil: boolean, withMultiSampling: boolean, indices?: number[]): void;
get debugPixels(): Uint8Array | undefined;
}
/** @internal */
export declare class FrameBufferStack {
private readonly _stack;
private get _top();
push(fbo: FrameBuffer, withAttachments: boolean, withMultSampling: boolean): void;
pop(): void;
get currentColorBuffer(): TextureHandle | undefined;
get currentFbMultisampled(): boolean;
get isEmpty(): boolean;
execute(fbo: FrameBuffer, withAttachments: boolean, withMultSampling: boolean, func: () => void): void;
markTargetsDirty(): void;
suspend(): void;
resume(): void;
}
//# sourceMappingURL=FrameBuffer.d.ts.map