Options
All
  • Public
  • Public/Protected
  • All
Menu

Thin wrapper around WebGLBuffer objects, making them easier to manage.

Hierarchy

  • GlBuffer

Index

Constructors

Methods

Constructors

constructor

  • new GlBuffer(gl: WebGLRenderingContext): GlBuffer

Methods

buffer

  • buffer(bufferName: string): WebGLBuffer
  • Gets the buffer with the provided name.

    Parameters

    • bufferName: string

      The name of the buffer to return.

    Returns WebGLBuffer

create

  • create(bufferName: string): void
  • Creates a new buffer with the provided name.

    Parameters

    • bufferName: string

      The name of the buffer to create.

    Returns void

setActive

  • setActive(bufferName: string, attribLocation: number, components?: number): void
  • Sets the named buffer as active, enables the provided attribute, and prepares the buffer for use.

    Parameters

    • bufferName: string

      The name of the buffer to activate.

    • attribLocation: number

      The location of the attribute to enable.

    • Default value components: number = 2

      The number of components per vertex.

    Returns void