Documentation / device / PBIfScope
Class: PBIfScope
Defined in: libs/device/src/builder/programbuilder.ts:4007
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:2772
Get the program builder
Returns
Inherited from
PBInsideFunctionScope.$builder
$builtins
Get Signature
get $builtins():
PBBuiltinScope
Defined in: libs/device/src/builder/programbuilder.ts:2776
Returns the scope of the builtin variables
Returns
Inherited from
PBInsideFunctionScope.$builtins
$inputs
Get Signature
get $inputs():
PBInputScope
Defined in: libs/device/src/builder/programbuilder.ts:2780
Returns the scope of the input variables
Returns
Inherited from
$outputs
Get Signature
get $outputs():
PBOutputScope
Defined in: libs/device/src/builder/programbuilder.ts:2784
Returns the scope of the output variables
Returns
Inherited from
PBInsideFunctionScope.$outputs
$l
Get Signature
get $l():
PBLocalScope
Defined in: libs/device/src/builder/programbuilder.ts:2812
Get the current local scope
Returns
Inherited from
$g
Get Signature
get $g():
PBGlobalScope
Defined in: libs/device/src/builder/programbuilder.ts:2816
Get the global scope
Returns
Inherited from
Methods
$getVertexAttrib()
$getVertexAttrib(
semantic):PBShaderExp
Defined in: libs/device/src/builder/programbuilder.ts:2808
Get the input vertex attribute by specified semantic
Parameters
semantic
The vertex semantic
Returns
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:2834
Query the global variable by the name
Parameters
name
string
Name of the variable
Returns
The variable or null if not exists
Inherited from
$return()
$return(
retval?):void
Defined in: libs/device/src/builder/programbuilder.ts:3689
Creates a 'return' statement
Parameters
retval?
The return value
Returns
void
Inherited from
$scope()
$scope(
body):PBInsideFunctionScope
Defined in: libs/device/src/builder/programbuilder.ts:3760
Creates a new scope
Parameters
body
(this) => void
Generator function for the scope
Returns
The created scope
Inherited from
$if()
$if(
condition,body):PBIfScope
Defined in: libs/device/src/builder/programbuilder.ts:3771
Creates an 'if' statement
Parameters
condition
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
$choice()
$choice(
condition,first,second):PBShaderExp
Defined in: libs/device/src/builder/programbuilder.ts:3788
Creates a select statement: condition ? first : second
Parameters
condition
Condition expression
first
The first value
second
The second value
Returns
The first value if condition evaluates to true, otherwise returns the second value
Inherited from
$break()
$break():
void
Defined in: libs/device/src/builder/programbuilder.ts:3803
Creates a 'break' statement
Returns
void
Inherited from
$continue()
$continue():
void
Defined in: libs/device/src/builder/programbuilder.ts:3807
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:3817
Creates a 'for' statement
Parameters
counter
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
$do()
$do(
body):PBDoWhileScope
Defined in: libs/device/src/builder/programbuilder.ts:3857
Creates a 'do..while' statement
Parameters
body
(this) => void
Generator function for the scope that inside the do..while statment
Returns
The scope that inside the do..while statement
Inherited from
$while()
$while(
condition,body):void
Defined in: libs/device/src/builder/programbuilder.ts:3870
Creates a 'while' statement
Parameters
condition
Condition expression for the while statement
body
(this) => void
Generator function for the scope that inside the while statement
Returns
void
Inherited from
$getMainScope()
$getMainScope():
PBFunctionScope
Defined in: libs/device/src/builder/programbuilder.ts:3889
Gets main function scope
Returns
Inherited from
PBInsideFunctionScope.$getMainScope
$elseif()
$elseif(
condition,body):PBIfScope
Defined in: libs/device/src/builder/programbuilder.ts:4022
Creates an 'else if' branch
Parameters
condition
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:4036
Creates an 'else' branch
Parameters
body
(this) => void
Generator function for the scope that insides the else statement
Returns
void