Skip to content

Documentation / device / PBInsideFunctionScope

Class: PBInsideFunctionScope

Defined in: libs/device/src/builder/programbuilder.ts:3837

Scope that is inside a function

Extends

Extended by

Indexable

[props: string]: any

Accessors

$thisProxy

Get Signature

get $thisProxy(): T

Defined in: libs/device/src/builder/base.ts:133

Returns

T

Inherited from

PBScope.$thisProxy


$builder

Get Signature

get $builder(): ProgramBuilder

Defined in: libs/device/src/builder/programbuilder.ts:2884

Get the program builder

Returns

ProgramBuilder

Inherited from

PBScope.$builder


$builtins

Get Signature

get $builtins(): PBBuiltinScope

Defined in: libs/device/src/builder/programbuilder.ts:2888

Returns the scope of the builtin variables

Returns

PBBuiltinScope

Inherited from

PBScope.$builtins


$inputs

Get Signature

get $inputs(): PBInputScope

Defined in: libs/device/src/builder/programbuilder.ts:2892

Returns the scope of the input variables

Returns

PBInputScope

Inherited from

PBScope.$inputs


$outputs

Get Signature

get $outputs(): PBOutputScope

Defined in: libs/device/src/builder/programbuilder.ts:2896

Returns the scope of the output variables

Returns

PBOutputScope

Inherited from

PBScope.$outputs


$l

Get Signature

get $l(): PBLocalScope

Defined in: libs/device/src/builder/programbuilder.ts:2924

Get the current local scope

Returns

PBLocalScope

Inherited from

PBScope.$l


$g

Get Signature

get $g(): PBGlobalScope

Defined in: libs/device/src/builder/programbuilder.ts:2928

Get the global scope

Returns

PBGlobalScope

Inherited from

PBScope.$g

Methods

$getVertexAttrib()

$getVertexAttrib(semantic): PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:2920

Get the input vertex attribute by specified semantic

Parameters

semantic

VertexSemantic

The vertex semantic

Returns

PBShaderExp

The input vertex attribute or null if not exists

Remarks

Can only be called only in vertex shader

Inherited from

PBScope.$getVertexAttrib


$query()

$query(name): PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:2946

Query the global variable by the name

Parameters

name

string

Name of the variable

Returns

PBShaderExp

The variable or null if not exists

Inherited from

PBScope.$query


$return()

$return(retval?): void

Defined in: libs/device/src/builder/programbuilder.ts:3846

Creates a 'return' statement

Parameters

retval?

ExpValueType

The return value

Returns

void


$scope()

$scope(body): PBInsideFunctionScope

Defined in: libs/device/src/builder/programbuilder.ts:3917

Creates a new scope

Parameters

body

(this) => void

Generator function for the scope

Returns

PBInsideFunctionScope

The created scope


$if()

$if(condition, body): PBIfScope

Defined in: libs/device/src/builder/programbuilder.ts:3928

Creates an 'if' statement

Parameters

condition

ExpValueNonArrayType

Condition expression for the if statement

body

(this) => void

Generator function for the scope inside the if statement

Returns

PBIfScope

The scope inside the if statement


$choice()

$choice(condition, first, second): PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3945

Creates a select statement: condition ? first : second

Parameters

condition

ExpValueNonArrayType

Condition expression

first

ExpValueNonArrayType

The first value

second

ExpValueNonArrayType

The second value

Returns

PBShaderExp

The first value if condition evaluates to true, otherwise returns the second value


$break()

$break(): void

Defined in: libs/device/src/builder/programbuilder.ts:3960

Creates a 'break' statement

Returns

void


$continue()

$continue(): void

Defined in: libs/device/src/builder/programbuilder.ts:3964

Creates a 'continue' statement

Returns

void


$for()

$for(counter, init, end, open?, reverse?, body?): void

Defined in: libs/device/src/builder/programbuilder.ts:3974

Creates a 'for' statement

Parameters

counter

PBShaderExp

The repeat counter variable declaration

init

number | PBShaderExp

initial value of the repeat counter variable

end

number | PBShaderExp

end value of the counter exclusive

open?

boolean | ((this) => void)

reverse?

boolean | ((this) => void)

body?

(this) => void

Generator function for the scope that inside the for statement

Returns

void


$do()

$do(body): PBDoWhileScope

Defined in: libs/device/src/builder/programbuilder.ts:4014

Creates a 'do..while' statement

Parameters

body

(this) => void

Generator function for the scope that inside the do..while statment

Returns

PBDoWhileScope

The scope that inside the do..while statement


$while()

$while(condition, body): void

Defined in: libs/device/src/builder/programbuilder.ts:4027

Creates a 'while' statement

Parameters

condition

ExpValueNonArrayType

Condition expression for the while statement

body

(this) => void

Generator function for the scope that inside the while statement

Returns

void


$getMainScope()

$getMainScope(): PBFunctionScope

Defined in: libs/device/src/builder/programbuilder.ts:4046

Gets main function scope

Returns

PBFunctionScope

Released under the MIT License.