Skip to content

textmode.js / TextmodeFramebuffer

Class: TextmodeFramebuffer

Framebuffer class for managing offscreen rendering targets initialized via Textmodifier.createFramebuffer.

TextmodeFramebuffer instances contain 3 attachments to support the rendering pipeline:

  • Attachment 0: Character and transform data (RGBA)
  • Attachment 1: charColor (RGBA)
  • Attachment 2: cellColor (RGBA)

Extends

  • Disposable

Accessors

AccessorDescription
attachmentCountNumber of color attachments available on this framebuffer.
framebufferThe underlying WebGLFramebuffer handle.
heightHeight of the framebuffer in pixels.
texturesThe color attachment textures owned by this framebuffer.
widthWidth of the framebuffer in pixels.

Methods

MethodDescription
beginBegin rendering into this framebuffer.
disposeDispose the framebuffer, attached textures, and optional depth renderbuffer.
endFinish rendering into this framebuffer and restore the previous framebuffer.
readPixelsRead RGBA pixel data from one attachment.
resizeResize the framebuffer and all attached textures.