mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { RenderFlow, RenderFlowInfo } from "../render-flow";
|
|
import { RenderPipeline } from "../render-pipeline";
|
|
import { TestStage } from "./test-stage";
|
|
|
|
export enum ForwardStagePriority {
|
|
FORWARD = 0,
|
|
};
|
|
|
|
export class ForwardFlow extends RenderFlow {
|
|
|
|
constructor(pipeline: RenderPipeline) {
|
|
super(pipeline);
|
|
}
|
|
|
|
public initialize(info: RenderFlowInfo): boolean {
|
|
|
|
if (info.name) {
|
|
this._name = info.name;
|
|
}
|
|
|
|
this._priority = info.priority;
|
|
|
|
let mainWindow = this._pipeline.root.mainWindow;
|
|
if(!mainWindow || !mainWindow.framebuffer) {
|
|
return false;
|
|
}
|
|
|
|
/*
|
|
this.createStage<ForwardStage>(ForwardStage, {
|
|
name: "ForwardStage",
|
|
priority: ForwardStagePriority.FORWARD,
|
|
framebuffer: mainWindow.framebuffer,
|
|
});
|
|
*/
|
|
|
|
this.createStage<TestStage>(TestStage, {
|
|
name: "TestStage",
|
|
priority: ForwardStagePriority.FORWARD,
|
|
framebuffer: mainWindow.framebuffer,
|
|
});
|
|
|
|
return true;
|
|
}
|
|
|
|
public destroy(): void {
|
|
this.destroyStages();
|
|
}
|
|
};
|