Skip to content

Documentation / device / PBIfScope

Class: PBIfScope ​

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

Scope that insides an if statement

Extends ​

Indexable ​

[props: string]: any

Accessors ​

$thisProxy ​

Get Signature ​

get $thisProxy(): T

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

Returns ​

T

Inherited from ​

PBInsideFunctionScope.$thisProxy


$builder ​

Get Signature ​

get $builder(): ProgramBuilder

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

Get the program builder

Returns ​

ProgramBuilder

Inherited from ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$l


$g ​

Get Signature ​

get $g(): PBGlobalScope

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

Get the global scope

Returns ​

PBGlobalScope

Inherited from ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$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 ​

PBInsideFunctionScope.$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

Inherited from ​

PBInsideFunctionScope.$return


$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

Inherited from ​

PBInsideFunctionScope.$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

Inherited from ​

PBInsideFunctionScope.$if


$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

Inherited from ​

PBInsideFunctionScope.$choice


$break() ​

$break(): void

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

Creates a 'break' statement

Returns ​

void

Inherited from ​

PBInsideFunctionScope.$break


$continue() ​

$continue(): void

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

Creates a 'continue' statement

Returns ​

void

Inherited from ​

PBInsideFunctionScope.$continue


$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

Inherited from ​

PBInsideFunctionScope.$for


$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

Inherited from ​

PBInsideFunctionScope.$do


$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

Inherited from ​

PBInsideFunctionScope.$while


$getMainScope() ​

$getMainScope(): PBFunctionScope

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

Gets main function scope

Returns ​

PBFunctionScope

Inherited from ​

PBInsideFunctionScope.$getMainScope


$elseif() ​

$elseif(condition, body): PBIfScope

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

Creates an 'else if' branch

Parameters ​

condition ​

ExpValueNonArrayType

Condition expression for the else if branch

body ​

(this) => void

Generator function for the scope that insides the else if statement

Returns ​

PBIfScope

The scope that insides the else if statement


$else() ​

$else(body): void

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

Creates an 'else' branch

Parameters ​

body ​

(this) => void

Generator function for the scope that insides the else statement

Returns ​

void

Released under the MIT License.