mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { GFXObject, GFXObjectType } from './define';
|
|
import { GFXDevice } from './device';
|
|
import { GFXRenderPass } from './render-pass';
|
|
import { GFXTextureView } from './texture-view';
|
|
|
|
export interface IGFXFramebufferInfo {
|
|
renderPass: GFXRenderPass;
|
|
colorViews: GFXTextureView[];
|
|
depthStencilView: GFXTextureView | null;
|
|
isOffscreen?: boolean;
|
|
}
|
|
|
|
export abstract class GFXFramebuffer extends GFXObject {
|
|
|
|
public get renderPass (): GFXRenderPass | null {
|
|
return this._renderPass;
|
|
}
|
|
|
|
public get colorViews (): GFXTextureView[] {
|
|
return this._colorViews;
|
|
}
|
|
|
|
public get depthStencilView (): GFXTextureView | null {
|
|
return this._depthStencilView;
|
|
}
|
|
|
|
public get isOffscreen (): boolean {
|
|
return this._isOffscreen;
|
|
}
|
|
|
|
protected _device: GFXDevice;
|
|
protected _renderPass: GFXRenderPass | null = null;
|
|
protected _colorViews: GFXTextureView[] = [];
|
|
protected _depthStencilView: GFXTextureView | null = null;
|
|
protected _isOffscreen: boolean = true;
|
|
|
|
constructor (device: GFXDevice) {
|
|
super(GFXObjectType.FRAMEBUFFER);
|
|
this._device = device;
|
|
}
|
|
|
|
public abstract initialize (info: IGFXFramebufferInfo): boolean;
|
|
public abstract destroy (): void;
|
|
}
|