Home Reference Source
import {WebGpuContext} from './core/cgp/cgp_state.js'
public class | source

WebGpuContext

Extends:

cables-shared-client~EventsCGState → WebGpuContext

cables webgpu context/state manager

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

CULL_MODES: string[]

public

DEPTH_FUNCS: string[]

public

gApi: *

public

patch: *

Private Members
private
private
private
private
private
private
private
private

_viewport: number[]

Method Summary

Public Methods
public

createMesh(geom: *, glPrimitive: *): *

public

getShader(): {}

public

getShader(): *

public

getViewPort(): number[]

public

getViewPort(): Array

public

pop face culling enabled state

public

pop face culling face side

public

pop depth compare func

public

pop depth testing state

public

pop depth writing state

public

popErrorScope(name: *, cb: *)

public

pop current used shader from shader stack

public

pushCullFace(b: Boolean)

push face culling face enabled state

public

push face culling face side

public

pushDepthFunc(f: string)

public

pushDepthTest(b: Boolean)

push depth testing enabled state

public

pushDepthWrite(b: Boolean)

push depth write enabled state

public
public

pushShader(shader: Object)

push a shader to the shader stack

public
public

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

public

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

public

stateCullFace(): Boolean

current state of face culling

public

stateCullFaceFacing(): Boolean

current state of face culling side

public

stateDepthFunc(): string

public

stateDepthTest(): Boolean

current state of depth testing

public

stateDepthWrite(): Boolean

current state of depth writing

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

canvasScale: number

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
private
private
private
private

_startMatrixStacks(identTranslate: *, identTranslateView: *)

Public Constructors

public constructor() source

Override:

CGState#constructor

Public Members

public CULL_MODES: string[] source

public DEPTH_FUNCS: string[] source

public gApi: * source

public patch: * source

Override:

CGState#patch

Private Members

private _shaderStack: *[] source

private _simpleShader: * source

private _stackCullFace: *[] source

private _stackCullFaceFacing: *[] source

private _stackDepthFunc: *[] source

private _stackDepthTest: *[] source

private _stackDepthWrite: *[] source

private _viewport: number[] source

Public Methods

public createMesh(geom: *, glPrimitive: *): * source

Params:

NameTypeAttributeDescription
geom *
glPrimitive *

Return:

*

public getShader(): {} source

Return:

{}

public getShader(): * source

Return:

*

public getViewPort(): number[] source

Return:

number[]

public getViewPort(): Array source

Return:

Array

array [x,y,w,h]

public popCullFace() source

pop face culling enabled state

public popCullFaceFacing() source

pop face culling face side

public popDepthFunc() source

pop depth compare func

public popDepthTest() source

pop depth testing state

public popDepthWrite() source

pop depth writing state

public popErrorScope(name: *, cb: *) source

Params:

NameTypeAttributeDescription
name *
cb *

public popShader() source

pop current used shader from shader stack

public pushCullFace(b: Boolean) source

push face culling face enabled state

Params:

NameTypeAttributeDescription
b Boolean

enabled

public pushCullFaceFacing(b: *) source

push face culling face side

Params:

NameTypeAttributeDescription
b *

public pushDepthFunc(f: string) source

Params:

NameTypeAttributeDescription
f string

depth compare func

public pushDepthTest(b: Boolean) source

push depth testing enabled state

Params:

NameTypeAttributeDescription
b Boolean

enabled

public pushDepthWrite(b: Boolean) source

push depth write enabled state

Params:

NameTypeAttributeDescription
b Boolean

enabled

public pushErrorScope() source

public pushShader(shader: Object) source

push a shader to the shader stack

Params:

NameTypeAttributeDescription
shader Object

public renderEnd() source

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

Params:

NameTypeAttributeDescription
cgp *
identTranslate *
identTranslateView *

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

Params:

NameTypeAttributeDescription
x *
y *
w *
h *

public stateCullFace(): Boolean source

current state of face culling

Return:

Boolean

enabled

public stateCullFaceFacing(): Boolean source

current state of face culling side

Return:

Boolean

enabled

public stateDepthFunc(): string source

Return:

string

public stateDepthTest(): Boolean source

current state of depth testing

Return:

Boolean

enabled

public stateDepthWrite(): Boolean source

current state of depth writing

Return:

Boolean

enabled