GlRectInstancer
Extends:
draw many rectangles quickly using GPU instancing (e.g. patchfield: ops,ports,text)
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
ATTR_COLOR: string |
|
public |
ATTR_CONTENT_TEX: string |
|
public |
ATTR_DECO: string |
|
public |
ATTR_POS: string |
|
public |
ATTR_SIZE: string |
|
public |
ATTR_TEXRECT: string |
|
public |
allowDragging: boolean |
|
public get |
bounds: * |
|
public |
doBulkUploads: boolean |
|
public set |
|
|
public get |
interactive: * |
Private Members | ||
private |
_DEFAULT_BIGNUM: number |
|
private |
_attrBuffCol: * |
|
private |
|
|
private |
_attrBuffPos: * |
|
private |
|
|
private |
|
|
private |
|
|
private |
_bounds: {"minX": *, "maxX": *, "minY": *, "maxY": *, "minZ": *, "maxZ": *} |
|
private |
_cgl: * |
|
private |
_counter: number |
|
private |
_debugRenderStyle: number |
|
private |
|
|
private |
_geom: * |
|
private |
_interactive: boolean |
|
private |
_log: * |
|
private |
_mesh: * |
|
private |
_meshAttrCol: * |
|
private |
|
|
private |
_meshAttrPos: * |
|
private |
|
|
private |
_meshAttrTex: * |
|
private |
|
|
private |
_name: * |
|
private |
_needsBoundsRecalc: boolean |
|
private |
_needsRebuild: boolean |
|
private |
_needsRebuildReason: string |
|
private |
_needsTextureUpdate: boolean |
|
private |
_newBounds: {"minX": *, "maxX": *, "minY": *, "maxY": *, "minZ": *, "maxZ": *} |
|
private |
_num: * |
|
private |
_reUploadAttribs: boolean |
|
private |
_rects: *[] |
|
private |
_shader: * |
|
private |
_textures: *[] |
|
private |
_uniResX: * |
|
private |
_uniResY: * |
|
private |
_uniTexture: * |
|
private |
_uniTime: * |
|
private |
_uniZoom: * |
|
private |
_unimsdfUnit: * |
|
private |
_uniscrollX: * |
|
private |
_uniscrollY: * |
|
private |
_updateRangesMax: {} |
|
private |
_updateRangesMin: {} |
Method Summary
Public Methods | ||
public |
clear() |
|
public |
createRect(options: *): * |
|
public |
dispose() |
|
public |
getDebug(): {"num": *, "len_attrBuffSizes": *, "len_attrBuffPos": *, "len_attrBuffCol": *, "len_attrBuffDeco": *} |
|
public |
getIndex(): * |
|
public |
getNumRects(): * |
|
public |
isDragging(): * |
|
public |
mouseDown(e: *) |
|
public |
mouseMove(x: *, y: *, button: *, event: *) |
|
public |
mouseUp(e: *) |
|
public |
rebuild() |
|
public |
render(resX: *, resY: *, scrollX: *, scrollY: *, zoom: *) |
|
public |
setAllTexture(tex: *, sdf: *) |
|
public |
setBorder(idx: *, o: *) |
|
public |
setColor(idx: *, r: *, g: *, b: *, a: *) |
|
public |
setDebugRenderer(i: *) |
|
public |
setPosition(idx: *, x: *, y: *, z: *) |
|
public |
setSelected(idx: *, o: *) |
|
public |
setShape(idx: *, o: *) |
|
public |
setSize(idx: *, x: *, y: *) |
|
public |
setTexRect(idx: *, x: *, y: *, w: *, h: *) |
Private Methods | ||
private |
|
|
private |
_float32Diff(a: *, b: *): * |
|
private |
_resetAttrRange(attr: *) |
|
private |
_setAttrRange(attr: *, start: *, end: *) |
|
private |
|
|
private |
|
Inherited Summary
From class Events | ||
public |
off: * |
|
public |
on: * |
|
private |
_eventCallbacks: {} |
|
private |
_listeners: {} |
|
private |
_log: * |
|
private |
_logEvents: boolean |
|
private |
_logName: string |
|
public |
addEventListener(which: *, cb: *, idPrefix: string): string add event listener |
|
public |
emitEvent(which: string, param1: *, param2: *, param3: *, param4: *, param5: *, param6: *) emit event |
|
public |
hasEventListener(id: *, cb: *): boolean check event listener registration |
|
public |
hasListenerForEventName(eventName: *): boolean check event listener by name |
|
public |
logEvents(enabled: boolean, logName: string) enable/disable logging of events for the class |
|
public |
removeEventListener(id: *, cb: *) rempve event listener registration |
Public Constructors
Public Members
public ATTR_COLOR: string source
public ATTR_CONTENT_TEX: string source
public ATTR_DECO: string source
public ATTR_POS: string source
public ATTR_SIZE: string source
public ATTR_TEXRECT: string source
public allowDragging: boolean source
public get bounds: * source
public doBulkUploads: boolean source
public set interactive source
public get interactive: * source
Private Members
private _DEFAULT_BIGNUM: number source
private _attrBuffCol: * source
private _attrBuffDeco: * source
private _attrBuffPos: * source
private _attrBuffSizes: * source
private _attrBuffTexRect: * source
private _attrBuffTextures: * source
private _bounds: {"minX": *, "maxX": *, "minY": *, "maxY": *, "minZ": *, "maxZ": *} source
private _cgl: * source
private _counter: number source
private _debugRenderStyle: number source
private _draggingRect: * source
private _geom: * source
private _interactive: boolean source
private _mesh: * source
private _meshAttrCol: * source
private _meshAttrDeco: * source
private _meshAttrPos: * source
private _meshAttrSize: * source
private _meshAttrTex: * source
private _meshAttrTexRect: * source
private _name: * source
private _needsBoundsRecalc: boolean source
private _needsRebuild: boolean source
private _needsRebuildReason: string source
private _needsTextureUpdate: boolean source
private _newBounds: {"minX": *, "maxX": *, "minY": *, "maxY": *, "minZ": *, "maxZ": *} source
private _num: * source
private _reUploadAttribs: boolean source
private _rects: *[] source
private _shader: * source
private _textures: *[] source
private _uniResX: * source
private _uniResY: * source
private _uniTexture: * source
private _uniTime: * source
private _uniZoom: * source
private _unimsdfUnit: * source
private _uniscrollX: * source
private _uniscrollY: * source
private _updateRangesMax: {} source
private _updateRangesMin: {} source
Public Methods
public clear() source
public dispose() source
public getDebug(): {"num": *, "len_attrBuffSizes": *, "len_attrBuffPos": *, "len_attrBuffCol": *, "len_attrBuffDeco": *} source
Return:
{"num": *, "len_attrBuffSizes": *, "len_attrBuffPos": *, "len_attrBuffCol": *, "len_attrBuffDeco": *} |
public mouseDown(e: *) source
Params:
Name | Type | Attribute | Description |
e | * |
public mouseMove(x: *, y: *, button: *, event: *) source
Params:
Name | Type | Attribute | Description |
x | * | ||
y | * | ||
button | * | ||
event | * |
public mouseUp(e: *) source
Params:
Name | Type | Attribute | Description |
e | * |
public rebuild() source
public render(resX: *, resY: *, scrollX: *, scrollY: *, zoom: *) source
Params:
Name | Type | Attribute | Description |
resX | * | ||
resY | * | ||
scrollX | * | ||
scrollY | * | ||
zoom | * |
public setAllTexture(tex: *, sdf: *) source
Params:
Name | Type | Attribute | Description |
tex | * | ||
sdf | * |
public setBorder(idx: *, o: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
o | * |
public setColor(idx: *, r: *, g: *, b: *, a: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
r | * | ||
g | * | ||
b | * | ||
a | * |
public setDebugRenderer(i: *) source
Params:
Name | Type | Attribute | Description |
i | * |
public setPosition(idx: *, x: *, y: *, z: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
x | * | ||
y | * | ||
z | * |
public setSelected(idx: *, o: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
o | * |
public setShape(idx: *, o: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
o | * |
public setSize(idx: *, x: *, y: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
x | * | ||
y | * |
public setTexRect(idx: *, x: *, y: *, w: *, h: *) source
Params:
Name | Type | Attribute | Description |
idx | * | ||
x | * | ||
y | * | ||
w | * | ||
h | * |
Private Methods
private _bindTextures() source
private _resetAttrRange(attr: *) source
Params:
Name | Type | Attribute | Description |
attr | * |
private _setAttrRange(attr: *, start: *, end: *) source
Params:
Name | Type | Attribute | Description |
attr | * | ||
start | * | ||
end | * |