The GLSL list data-type.
The name of the GLSL list variable.
The list of GLSL values.
Optionalqualify: string = ''A GLSL qualifier, if needed (e.g: const).
Optionalglsl: number = 1The GLSL version to target, if specified.
Optionalinit: stringA data-type initialiser.
The GLSL (1 or 3) array or array-like declaration string.
Creates a
GLSLdefinition of an array, and initialises it with the given values, type, and variable name.The initialisation is valid
GLSL1or greater syntax; but is written with escaped new-lines so it may be used in a single-line (e.g: for preprocessor macros).For a
qualifyofconston anyGLSL< 3, falls back to using non-array variables with the index appended toname, sinceconstarrays aren't supported beforeGLSL3.See
Example: ```javascript getGLSLList('int', 'test', [0, 1]); // => 'const int test_l = 2;'+lf+ 'int test_0 = int(0);'+lf+ 'int test_1 = int(1);'+lf+ 'int test[test_l];'+lf+ 'test[0] = test_0;'+lf+ 'test[1] = test_1;\n'+ '#define test_i(i) test[i]\n'; getGLSLList('ivec2', 'vecs', [[1, 0], [0, 1]], 'const', 3); // => 'const int vecs_l = 2;'+lf+ 'ivec2 vecs_0 = ivec2(1, 0);'+lf+ 'ivec2 vecs_1 = ivec2(0, 1);'+lf+ 'const ivec2 vecs[vecs_l] = ivec2[vecs_l](vecs_0, vecs_1);\n'+ '#define vecs_i(i) vecs[i]\n'; getGLSLList('int', 'listLike', [0, 1], 'const', 1); // => 'const int listLike_l = 2;'+lf+ 'const int listLike_0 = int(0);'+lf+ 'const int listLike_1 = int(1);\n'+ '// Index macro `listLike_i` (e.g: `listLike_i(0)`) may be slow, `+ 'use name (e.g: `listLike_0`) if possible.\n'+ '#define listLike_i(i) ((i == 1)? listLike_1 : listLike_0)\n'; ```