import { gl , IFramebuffer , IFramebufferInitializationOptions , IRenderbuffer , ITexture2D , } from '@antv/g-webgpu-core' ; import regl from 'regl' ; import ReglTexture2D from './ReglTexture2D' ; see https export default class ReglFramebuffer implements IFramebuffer { private framebuffer : regl . Framebuffer ; constructor ( reGl , options ) { const { width , height , color , colors , depth , stencil } = options ; const framebufferOptions = { width , height , } ; if ( Array . isArray ( colors ) ) { framebufferOptions . colors = colors . map ( ( c ) => ( c as ReglTexture2D ) . get ( ) ) ; } if ( color && typeof color !== 'boolean' ) { framebufferOptions . color = ( color as ReglTexture2D ) . get ( ) ; } this . framebuffer = reGl . framebuffer ( framebufferOptions ) ; } public get ( ) { return this . framebuffer ; } public destroy ( ) { this . framebuffer . destroy ( ) ; } public resize ( { width , height } ) { this . framebuffer . resize ( width , height ) ; } }