Options
All
  • Public
  • Public/Protected
  • All
Menu

System plugin to the renderer to manage framebuffers.

memberof

PIXI

Hierarchy

Index

Constructors

constructor

Properties

Protected CONTEXT_UID

CONTEXT_UID: number

current

current: Framebuffer

Protected gl

hasMRT

hasMRT: boolean

Readonly managedFramebuffers

managedFramebuffers: Framebuffer[]

Protected msaaSamples

msaaSamples: number[]

renderer

renderer: Renderer

Protected unknownFramebuffer

unknownFramebuffer: Framebuffer

viewport

viewport: Rectangle

writeDepthTexture

writeDepthTexture: boolean

Accessors

size

  • get size(): { height: number; width: number; x: number; y: number }
  • Get the size of the current width and height. Returns object with width and height values.

    member

    {object}

    readonly

    Returns { height: number; width: number; x: number; y: number }

    • height: number
    • width: number
    • x: number
    • y: number

Methods

bind

  • Bind a framebuffer

    Parameters

    Returns void

blit

  • Only works with WebGL2

    blits framebuffer to another of the same or bigger size after that target framebuffer is bound

    Fails with WebGL warning if blits multisample framebuffer to different size

    Parameters

    Returns void

clear

  • clear(r: number, g: number, b: number, a: number, mask?: BUFFER_BITS): void
  • Clear the color of the context

    Parameters

    • r: number

      Red value from 0 to 1

    • g: number

      Green value from 0 to 1

    • b: number

      Blue value from 0 to 1

    • a: number

      Alpha value from 0 to 1

    • Optional mask: BUFFER_BITS

    Returns void

Protected contextChange

  • contextChange(): void
  • Sets up the renderer context and necessary buffers.

    Returns void

destroy

  • destroy(): void
  • Generic destroy methods to be overridden by the subclass

    Returns void

Protected detectSamples

  • Detects number of samples that is not more than a param but as close to it as possible

    Parameters

    Returns MSAA_QUALITY

    • recommended number of samples

disposeAll

  • disposeAll(contextLost?: boolean): void
  • Disposes all framebuffers, but not textures bound to them

    Parameters

    • Optional contextLost: boolean

    Returns void

disposeFramebuffer

  • disposeFramebuffer(framebuffer: Framebuffer, contextLost?: boolean): void
  • Disposes framebuffer

    Parameters

    • framebuffer: Framebuffer

      framebuffer that has to be disposed of

    • Optional contextLost: boolean

    Returns void

Private forceStencil

  • forceStencil(): void
  • Forcing creation of stencil buffer for current framebuffer, if it wasn't done before. Used by MaskSystem, when its time to use stencil mask for Graphics element.

    Its an alternative for public lazy framebuffer.enableStencil, in case we need stencil without rebind.

    Returns void

Protected initFramebuffer

  • Initialize framebuffer for this context

    Parameters

    Returns GLFramebuffer

    created GLFramebuffer

reset

  • reset(): void
  • resets framebuffer stored state, binds screen framebuffer

    should be called before renderTexture reset()

    Returns void

Protected resizeFramebuffer

  • Resize the framebuffer

    Parameters

    Returns void

setViewport

  • setViewport(x: number, y: number, width: number, height: number): void
  • Set the WebGLRenderingContext's viewport.

    Parameters

    • x: number

      X position of viewport

    • y: number

      Y position of viewport

    • width: number

      Width of viewport

    • height: number

      Height of viewport

    Returns void

Protected updateFramebuffer

  • Update the framebuffer

    Parameters

    Returns void

Generated using TypeDoc