PokéRogue
    Preparing search index...

    Wrapper for a WebGL Vertex Array Object (VAO).

    A VAO stores the complete vertex attribute configuration for a draw call, including attribute pointer definitions, enabled attribute arrays, and the bound element array buffer. Binding a VAO before drawing restores all of this state in a single call, reducing the number of WebGL API calls needed per frame.

    A raw WebGLVertexArrayObject 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 WebGLVAOWrapper instead.

    Index
    attributeBufferLayouts: WebGLVertexBufferLayoutWrapper[]

    The vertex buffers containing attribute data for this VAO, alongside the relevant attribute layout.

    glState: object

    The state object used to bind this VAO.

    indexBuffer: WebGLBufferWrapper | null

    The element array buffer used in this VAO, if any.

    The shader program that this VAO is associated with.

    renderer: WebGLRenderer

    The WebGLRenderer instance that owns this wrapper.

    vertexArrayObject: WebGLVertexArrayObject | null

    The WebGLVertexArrayObject 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.

    • Binds this WebGLVAOWrapper to the current WebGLRenderingContext.

      Returns void

    • Creates a new WebGLVertexArrayObject and records the full vertex attribute configuration into it. This includes binding the optional index buffer, enabling each vertex attribute array, setting up the attribute pointers (including per-column pointers for matrix attributes), and applying instance divisors for instanced rendering. Once the VAO is fully configured it is unbound, along with any array and element-array buffers, to leave the WebGL state clean.

      This method is called automatically by the constructor. It is also called by the WebGLRenderer when the WebGL context is restored after a context loss event.

      Returns void

    • Destroys this WebGLVAOWrapper and removes all associated resources.

      Returns void