Skip to content

WebGLNodeDrawable

Overview

WebGL drawable for WebGLNode.

@author Jonathan Olson <jonathan.olson@colorado.edu> @author Sam Reid (PhET Interactive Simulations)

Class WebGLNodeDrawable

import { WebGLNodeDrawable } from 'scenerystack/scenery';

Instance Methods

initialize( renderer, instance )

@public @override

@param {number} renderer @param {Instance} instance

createPainter()

Creates an instance of our Node's "painter" type. @private

@returns {*} - Whatever node.painterType is will be the type.

onWebGLContextChange()

Callback for when the WebGL context changes. We'll reconstruct the painter. @public

onAddToBlock( webGLBlock )

@public

@param {WebGLBlock} webGLBlock

onRemoveFromBlock( webGLBlock )

@public

@param {WebGLBlock} webGLBlock

draw()

@public

@returns {WebGLNode.PAINTED_NOTHING|WebGLNode.PAINTED_SOMETHING}

dispose()

Disposes the drawable. @public @override

markPaintDirty()

A "catch-all" dirty method that directly marks the paintDirty flag and triggers propagation of dirty information. This can be used by other mark* methods, or directly itself if the paintDirty flag is checked. @public

It should be fired (indirectly or directly) for anything besides transforms that needs to make a drawable dirty.

Source Code

See the source for WebGLNodeDrawable.js in the scenery repository.