Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NdcFillingRectangle

Geometry for a viewport/screen-filling rectangle. The geometry creates rectangle vertices, associated to a vertex array object (from geometry base class), and provides a specialized draw call for rendering. It is intended for, e.g., viewport/screen-filling rendering in post-processing. The vertices can be used directly as normalized device space (NDC) coordinates, e.g., by using the following vertex shader snippet:

#if __VERSION__ == 100
    attribute vec2 a_vertex;
#else
    layout(location = 0) in vec2 a_vertex;
#endif

...

v_uv = a_vertex * 0.5 + 0.5;
gl_Position = vec4(a_vertex, 0.0, 1.0);

Hierarchy

Index

Constructors

constructor

Properties

Protected _buffers

_buffers: Buffer[] = ...

Various buffers required for this geometry (e.g., vertex buffer).

Protected _vertexArray

_vertexArray: VertexArray

Vertex array used for binding the rectangle's buffer(s).

Protected _vertexLocation

_vertexLocation: number

Protected assertInitialized

assertInitialized: () => void = ...

Asserts the objects initialization status to be true. Note that the implementation is cached and forwarded to either an empty function when initialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Protected assertUninitialized

assertUninitialized: () => void = ...

Asserts the objects initialization status to be false. Note that the implementation is cached and forwarded to either an empty function when uninitialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Static Protected Readonly VERTICES

VERTICES: Float32Array = ...

2 ───── 3 │ \ │ │ \ │ 0 ───── 1

Accessors

buffers

context

initialized

  • get initialized(): boolean
  • Property getter for readonly access to the initialization status of an initializable instance.

    Returns boolean

vertexArray

vertexLocation

  • get vertexLocation(): number

Methods

bind

  • bind(): void

Protected bindBuffers

  • bindBuffers(): void

draw

  • draw(): void

initialize

  • initialize(vertexLocation?: number): boolean
  • Creates the vertex buffer object (VBO) and creates and initializes the buffer's data store.

    Parameters

    • vertexLocation: number = 0

      Attribute binding point for vertices.

    Returns boolean

unbind

  • unbind(): void

Protected unbindBuffers

  • unbindBuffers(): void

uninitialize

  • uninitialize(): void

Static Protected Readonly assertInitializedFalse

Static Protected Readonly assertUninitializedFalse

Static assert_initialized

  • assert_initialized(): MethodDecorator

Static assert_uninitialized

  • assert_uninitialized(): MethodDecorator

Static discard

  • discard(): MethodDecorator
  • Method decorator for discarding of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be discarded, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator

Static initialize

  • initialize(): MethodDecorator
  • Method decorator for initialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be initialized, invokes its initialization with arbitrary number of parameters, and sets the initialization status to the initialization success (either false or true). In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to either a static, always-failing assert or an empty/undefined function.

    Returns MethodDecorator

Static uninitialize

  • uninitialize(): MethodDecorator
  • Method decorator for uninitialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be uninitialized, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator