Home Reference Source
import {Context} from './core/cgl/cgl_state.js'
public class | source

Context

Extends:

cables-shared-client~EventsCGState → Context

cables gl context/state manager

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

CULL_MODES: undefined[]

public

DEPTH_FUNCS: undefined[]

public

aborted: boolean

public

checkGlErrors: boolean

public

clearCanvasDepth: boolean

public
public
public

debugOneFrame: boolean

public
public

gApi: *

public

gl: *

public
public

glSlowRenderer: boolean

public
public

glVersion: number

public

mMatrix: *

public
public

maxAnisotropic: number

public

maxSamples: number

public
public

maxTextureUnits: number

public
public
public
public get
public set
public
public
public
public
public get
Private Members
private

_currentCursor: string

private
private

_cursor: string

private
private
private

_frameStarted: boolean

private
private

_hadStackError: boolean

private

_isSafariCrap: boolean

private

_log: *

private

_loggedGlError: boolean

private
private
private
private
private
private
private

_viewPort: number[]

private

Method Summary

Public Methods
public

checkFrameStarted(string: *)

log warning to console if the rendering of one frame has not been started / handy to check for async problems

public
public
public

get current framebuffer

public

get current framebuffer

public
public

getInfo(): {"glVersion": *, "glRenderer": *, "glUseHalfFloatTex": *, "maxVaryingVectors": *, "maxTextureUnits": *, "maxTexSize": *, "maxUniformsFrag": *, "maxUniformsVert": *, "maxSamples": *}

public

getShader(): *

public

getTexture(slot: *): *

public
public
public

logStackError(str: *)

public

pop framebuffer stack

public

popGlFrameBuffer(): Object

pop framebuffer stack

public
public

printError(str: *): *

public

push a framebuffer to the framebuffer stack

public

pushGlFrameBuffer(fb: Object)

push a framebuffer to the framebuffer stack

public

pushShader(shader: Object)

push a shader to the shader stack

public

pushViewPort(x: Number, y: Number, w: Number, h: Number)

public

renderEnd(cgl: *)

public

renderStart(cgl: *, identTranslate: *, identTranslateView: *)

public
public

saveScreenshot(filename: *, cb: *, pw: *, ph: *, noclearalpha: *)

public

screenShot(cb: *, doScreenshotClearAlpha: *, mimeType: *, quality: *)

public

pop current used shader from shader stack

public

setTexture(slot: *, t: *, type: *): boolean

public

setViewPort(x: *, y: *, w: *, h: *)

Private Methods
private
private

_setCanvas(canv: *)

Inherited Summary

From class CGState
public get

canvas: *

public get
public get
public get
public set
public
public
public
public
public
public
public
public
public

aborted: boolean

public

autoReSize: boolean

public

canvasScale: number

public
public
public
public

mMatrix: mat4

Current model matrix

public

pMatrix: mat4

Current projection matrix

public

patch: *

public

vMatrix: mat4

Current view matrix

private

_ident: *

private
private
private
private
private
public
public
public
public
public

modelMatrix(): mat4

get model matrix

public

popModelMatrix(): mat4

pop model matrix stack

public

popPMatrix(): mat4

pop projection matrix stack

public

popViewMatrix(): mat4

pop view matrix stack

public

push a matrix to the model matrix stack

public

push a matrix to the projection matrix stack

public

push a matrix to the view matrix stack

public

setAutoResize(parent: *)

public

setCanvas(canvEle: *)

public

setSize(w: *, h: *, ignorestyle: *)

public

shouldDrawHelpers(): boolean

public
private
private
private
private

_startMatrixStacks(identTranslate: *, identTranslateView: *)

Public Constructors

public constructor() source

Override:

CGState#constructor

Public Members

public CULL_MODES: undefined[] source

public DEPTH_FUNCS: undefined[] source

public aborted: boolean source

Override:

CGState#aborted

public checkGlErrors: boolean source

public clearCanvasDepth: boolean source

public clearCanvasTransparent: boolean source

public currentProgram: * source

public debugOneFrame: boolean source

public frameStore: {} source

Override:

CGState#frameStore

public gApi: * source

public gl: * source

public glRenderer: * source

public glSlowRenderer: boolean source

public glUseHalfFloatTex: boolean source

public glVersion: number source

public mMatrix: * source

Current model matrix

Override:

CGState#mMatrix

public mainloopOp: * source

public maxAnisotropic: number source

public maxSamples: number source

public maxTexSize: * source

public maxTextureUnits: number source

public maxUniformsFrag: * source

public maxUniformsVert: * source

public maxVaryingVectors: number source

public get mvMatrix: * source

public set mvMatrix source

public popMvMatrix: * source

public profileData: * source

public pushMvMatrix: * source

public temporaryTexture: * source

public get viewPort: * source

Private Members

private _currentCursor: string source

private _currentShader: * source

private _cursor: string source

private _enabledExtensions: {} source

private _frameBufferStack: *[] source

private _frameStarted: boolean source

private _glFrameBufferStack: *[] source

private _hadStackError: boolean source

private _isSafariCrap: boolean source

private _log: * source

private _loggedGlError: boolean source

private _oldCanvasHeight: * source

private _oldCanvasWidth: * source

private _onetimeCallbacks: *[] source

private _shaderStack: *[] source

private _simpleShader: * source

private _stackDepthTest: *[] source

private _viewPort: number[] source

private _viewPortStack: *[] source

Public Methods

public checkFrameStarted(string: *) source

log warning to console if the rendering of one frame has not been started / handy to check for async problems

Params:

NameTypeAttributeDescription
string *

public endFrame() source

public fullScreen() source

public getCurrentFrameBuffer(): Framebuffer source

get current framebuffer

Return:

Framebuffer

current framebuffer or null

public getCurrentGlFrameBuffer(): Object source

get current framebuffer

Return:

Object

current framebuffer or null

public getDefaultShader(): * source

Return:

*

public getInfo(): {"glVersion": *, "glRenderer": *, "glUseHalfFloatTex": *, "maxVaryingVectors": *, "maxTextureUnits": *, "maxTexSize": *, "maxUniformsFrag": *, "maxUniformsVert": *, "maxSamples": *} source

Return:

{"glVersion": *, "glRenderer": *, "glUseHalfFloatTex": *, "maxVaryingVectors": *, "maxTextureUnits": *, "maxTexSize": *, "maxUniformsFrag": *, "maxUniformsVert": *, "maxSamples": *}

public getShader(): * source

Return:

*

public getTexture(slot: *): * source

Params:

NameTypeAttributeDescription
slot *

Return:

*

public getViewPort(): * source

Return:

*

public hasFrameStarted(): * source

Return:

*

public logStackError(str: *) source

Params:

NameTypeAttributeDescription
str *

public popFrameBuffer(): Framebuffer source

pop framebuffer stack

Return:

Framebuffer

current framebuffer or null

public popGlFrameBuffer(): Object source

pop framebuffer stack

Return:

Object

current framebuffer or null

public popViewPort() source

public printError(str: *): * source

Params:

NameTypeAttributeDescription
str *

Return:

*

public pushFrameBuffer(fb: Framebuffer) source

push a framebuffer to the framebuffer stack

Params:

NameTypeAttributeDescription
fb Framebuffer

framebuffer

public pushGlFrameBuffer(fb: Object) source

push a framebuffer to the framebuffer stack

Params:

NameTypeAttributeDescription
fb Object

framebuffer

public pushShader(shader: Object) source

push a shader to the shader stack

Params:

NameTypeAttributeDescription
shader Object

public pushViewPort(x: Number, y: Number, w: Number, h: Number) source

Params:

NameTypeAttributeDescription
x Number
y Number
w Number
h Number

public renderEnd(cgl: *) source

Params:

NameTypeAttributeDescription
cgl *

public renderStart(cgl: *, identTranslate: *, identTranslateView: *) source

Params:

NameTypeAttributeDescription
cgl *
identTranslate *
identTranslateView *

public resetViewPort() source

public saveScreenshot(filename: *, cb: *, pw: *, ph: *, noclearalpha: *) source

Params:

NameTypeAttributeDescription
filename *
cb *
pw *
ph *
noclearalpha *

public screenShot(cb: *, doScreenshotClearAlpha: *, mimeType: *, quality: *) source

Params:

NameTypeAttributeDescription
cb *
doScreenshotClearAlpha *
mimeType *
quality *

public setPreviousShader() source

pop current used shader from shader stack

public setTexture(slot: *, t: *, type: *): boolean source

Params:

NameTypeAttributeDescription
slot *
t *
type *

Return:

boolean

public setViewPort(x: *, y: *, w: *, h: *) source

Params:

NameTypeAttributeDescription
x *
y *
w *
h *

Private Methods

private _dispose() source

private _setCanvas(canv: *) source

Params:

NameTypeAttributeDescription
canv *