#define GLSL(str) (char*)"#version 330\n" #str
It basically enables you to embed quick snippets of GLSL inside your C code, instead of using concatenated strings. Example: char* fragShader = GLSL(
in vec3 uv;
out vec4 color;
uniform sampler2DArray tex;
void main()
{
// Comments work too
color = texture(tex, uv);
}
);
In Sublime Text you even get code completion and color highlighting, since GLSL and C look so alike. var list = [0,1,2,3];
var sum = 0;
for (var i = 0; i < list.length; i++)
sum += list[i];
> Anyway, if all you want is a safe loop construct, recursion isn't the only option. [0,1,2,3].reduce(function(a,b){return a+b;}, 0);
Or: sum [0,1,2,3]
in haskell ;)
https://www.unrealengine.com/blog/unreal-engine-4-14-release...