phaser - v3.90.0
    Preparing search index...

    Wrapper for a WebGL buffer, containing all the information that was used to create it. This can be a VertexBuffer or IndexBuffer.

    A WebGLBuffer should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLBufferWrapper instead.

    Index

    Constructors

    • Parameters

      • gl: WebGLRenderingContext

        The WebGLRenderingContext to create the WebGLBuffer for.

      • initialDataOrSize: number | ArrayBuffer

        Either an ArrayBuffer of data, or the size of the buffer to create.

      • bufferType: number

        The type of the buffer being created.

      • bufferUsage: number

        The usage of the buffer being created. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.

      Returns WebGLBufferWrapper

    Properties

    bufferType: number

    The type of the buffer.

    bufferUsage: number

    The usage of the buffer. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.

    gl: WebGLRenderingContext

    The WebGLRenderingContext that owns this WebGLBuffer.

    initialDataOrSize: number | ArrayBuffer

    The initial data or size of the buffer.

    Note that this will be used to recreate the buffer if the WebGL context is lost.

    webGLBuffer: WebGLBuffer

    The WebGLBuffer being wrapped by this class.

    This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.

    Methods

    • Creates a WebGLBuffer for this WebGLBufferWrapper.

      This is called automatically by the constructor. It may also be called again if the WebGLBuffer needs re-creating.

      Returns void

    • Remove this WebGLBufferWrapper from the GL context.

      Returns void