Engine API Reference
    Preparing search index...

    Class QuadRender

    An object that renders a quad using a Shader.

    Example:

    const shader = pc.createShaderFromCode(app.graphicsDevice, vertexShader, fragmentShader, `MyShader`);
    const quad = new QuadRender(shader);
    quad.render();
    quad.destroy();
    Index

    Constructors

    Methods

    Constructors

    • Create a new QuadRender instance.

      Parameters

      • shader: Shader

        The shader to be used to render the quad.

      Returns QuadRender

    Methods

    • Destroys the resources associated with this instance.

      Returns void

    • Renders the quad. If the viewport is provided, the original viewport and scissor is restored after the rendering.

      Parameters

      • Optionalviewport: Vec4

        The viewport rectangle of the quad, in pixels. The viewport is not changed if not provided.

      • Optionalscissor: Vec4

        The scissor rectangle of the quad, in pixels. Used only if the viewport is provided.

      Returns void