Skip to content

Data Types

BSL supports many different intrinsic data types.

Scalar

BSL supports several scalar data types:

  • bool - true or false.
  • int - 32-bit signed integer.
  • uint - 32-bit unsigned integer.
  • float - 32-bit floating point value.

Vector

A vector contains between one and four scalar components; every component of a vector must be of the same type.

TypeNumber Name
Item Description
TypeNumber A single name that contains two parts. The first part is one of the scalar types. The second part is the number of components, which must be between 1 and 4 inclusive.
Name An ASCII string that uniquely identifies the variable name.

Examples:

bool    bVector;   // scalar containing 1 Boolean
int1    iVector = 1;
float3  fVector = { 0.2f, 0.3f, 0.4f };
float4  color = { 0.5, 1, 0.2, 1 };

Struct

A structure is a collection of its own data and functions. Here a list of built-in structures :

incomplete

User defined enum

User can define enums ( interpreted by default as uint )

This is how to declare an enum:

enum Test {
    Value0      ;
    Value1      ;
    Value2 = 4  ;
    Value3      ;  // Value3 == 5 
    Value5 = 5  ;
}

Typical use of an enum:

int a = Test.Value3 ;