Files
cocos4/cocos/core/gfx/framebuffer.ts
T
pandamicro 9f89b0ef24 New module division (#5285)
* Temp

* temp

* move ui core

* Arrange ui and terrain

* Fix import path for all modules except core

* Move primitives into core

* Fix debug.getError

* Move audio-downloader to audio module

* export game from game.ts

* Migrate load-pipeline to ts

* Fix core modules and cleanup

* Move animation into core

* Fix module exports

* Fix director issue

* Remove most cc.director usage

* Fix ts issues

* Fix issues for unit test and editor running

* Revert removing deprecated import

* tweaks

* tweaks

* Fix ci

* Fix ci

* Add modules in module division

* Upgrade coordinates-converts-utils
2019-08-30 11:35:22 +08:00

111 lines
2.1 KiB
TypeScript

/**
* @category gfx
*/
import { GFXObject, GFXObjectType } from './define';
import { GFXDevice } from './device';
import { GFXRenderPass } from './render-pass';
import { GFXTextureView } from './texture-view';
/**
* @zh
* GFX帧缓冲描述信息。
*/
export interface IGFXFramebufferInfo {
renderPass: GFXRenderPass;
colorViews: GFXTextureView[];
depthStencilView: GFXTextureView | null;
isOffscreen?: boolean;
}
/**
* @zh
* GFX帧缓冲。
*/
export abstract class GFXFramebuffer extends GFXObject {
/**
* @zh
* GFX渲染过程。
*/
public get renderPass (): GFXRenderPass | null {
return this._renderPass;
}
/**
* @zh
* 颜色纹理视图数组。
*/
public get colorViews (): GFXTextureView[] {
return this._colorViews;
}
/**
* @zh
* 深度模板纹理视图。
*/
public get depthStencilView (): GFXTextureView | null {
return this._depthStencilView;
}
/**
* @zh
* 是否是离屏的。
*/
public get isOffscreen (): boolean {
return this._isOffscreen;
}
/**
* @zh
* GFX设备。
*/
protected _device: GFXDevice;
/**
* @zh
* GFX渲染过程。
*/
protected _renderPass: GFXRenderPass | null = null;
/**
* @zh
* 颜色纹理视图数组。
*/
protected _colorViews: GFXTextureView[] = [];
/**
* @zh
* 深度模板纹理视图。
*/
protected _depthStencilView: GFXTextureView | null = null;
/**
* @zh
* 是否是离屏的。
*/
protected _isOffscreen: boolean = true;
/**
* 构造函数。
* @param device GFX设备。
*/
constructor (device: GFXDevice) {
super(GFXObjectType.FRAMEBUFFER);
this._device = device;
}
/**
* @zh
* 初始化函数。
* @param info GFX帧缓冲描述信息。
*/
public abstract initialize (info: IGFXFramebufferInfo): boolean;
/**
* @zh
* 销毁函数。
*/
public abstract destroy (): void;
}