-
Notifications
You must be signed in to change notification settings - Fork 34
/
fbo.d.ts
40 lines (40 loc) · 1.39 KB
/
fbo.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Texture2D from './texture-2d';
import RenderBuffer from './renderbuffer';
import { GLContext } from './types';
export type AttachmentTarget = Texture2D | RenderBuffer;
export declare class Attachment {
level: number;
readonly target: AttachmentTarget;
private _isTexture;
constructor(target: AttachmentTarget);
isTexture(): boolean;
_resize(w: number, h: number): void;
_attach(bindingPoint: GLenum): void;
_detach(bindingPoint: GLenum): void;
dispose(): void;
}
declare class Fbo {
readonly gl: GLContext;
readonly fbo: WebGLFramebuffer;
readonly attachmentsList: Attachment[];
attachments: Record<string, Attachment>;
width: number;
height: number;
constructor(gl: GLContext);
attach(bindingPoint: GLenum, res: AttachmentTarget): Attachment;
detach(bindingPoint: GLenum): void;
getAttachment(bindingPoint: GLenum): Attachment | null;
getColor(index?: number): AttachmentTarget | null;
getColorTexture(index?: number): Texture2D;
getDepth(): AttachmentTarget | null;
attachColor(format?: GLenum, type?: GLenum, internal?: GLenum): Attachment;
attachDepth(depth?: boolean, stencil?: boolean, useTexture?: boolean): Attachment;
resize(w: number, h: number): void;
bind(): void;
clear(): void;
defaultViewport(): void;
isValid(): boolean;
dispose(): void;
_allocate(): void;
}
export default Fbo;