Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Geometry

Geometry that extends Initializable and Bindable by a draw method, a getter for buffers, as well as a getter for the vertex array object. This is used as generic interface for one or more buffer objects associated to a single vertex array object intended for drawing (often also referred to as 'drawable').

Hierarchy

Implements

Index

Constructors

constructor

  • new Geometry(context: Context, identifier?: undefined | string): Geometry
  • Creates the geometry and a vertex array instance. Please note that inheritors are expected to create the buffer.

    Parameters

    • context: Context

      Valid context to create the object for.

    • Optional identifier: undefined | string

      Meaningful name for identification of this instances VAO and VBOs.

    Returns Geometry

Properties

Protected _buffers

_buffers: Buffer[] = new Array<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).

Accessors

buffers

  • get buffers(): Array<Buffer>
  • Read-only access to the buffer(s) associated to this instances vertex array object.

    Returns Array<Buffer>

context

initialized

  • get initialized(): boolean

vertexArray

Methods

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.

    Returns void

Protected assertUninitialized

  • assertUninitialized(): undefined
  • 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.

    Returns undefined

bind

  • bind(): void
  • Binds the vertex array object.

    Returns void

Protected Abstract bindBuffers

  • bindBuffers(indices: Array<GLuint>): void
  • Binds all buffer object(s) to their associated attribute binding points (pre-defined index/indices). This function is passed to the initialization of this geometries vertex array object.

    Parameters

    • indices: Array<GLuint>

      Indices passed on geometry initialization by inheritor (sequence as in buffers).

    Returns void

Abstract draw

  • draw(): void

initialize

  • initialize(...args: any[]): boolean
  • Initializes all buffer objects and the vertex array. Please note that implicit arguments are used in order to enable custom initialization signatures for inheritors.

    Parameters

    • Rest ...args: any[]

    Returns boolean

unbind

  • unbind(): void

Protected Abstract unbindBuffers

  • unbindBuffers(indices: Array<GLuint>): void
  • Unbinds all buffer objects and disables their binding points. This function is passed to the uninitialization of this geometries vertex array object.

    Parameters

    • indices: Array<GLuint>

      Indices passed on geometry initialization by inheritor (sequence as in buffers).

    Returns void

uninitialize

  • uninitialize(): void

Static Protected assertInitializedFalse

Static Protected assertUninitializedFalse

Static assert_initialized

Static assert_uninitialized

Static initialize

  • 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

  • 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