WebGL rotating F: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
 
Line 553:
 
As with any Open GL aplication, the Wren code needs to be embedded in a host application which can communicate directly with the relevant libraries and which I've written here in C.
<syntaxhighlight lang="ecmascriptwren">/* webgl_rotating_FWebGL_rotating_F.wren */
 
import "./math" for Math
Line 1,250:
<br>
We now embed the above code in the following C program, compile and run.
<syntaxhighlight lang="c">/* gcc webgl_rotating_FWebGL_rotating_F.c -o webgl_rotating_FWebGL_rotating_F -lglut -lGLESv2 -lm -lwren */
 
#include <stdlib.h>
Line 1,556:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "webgl_rotating_FWebGL_rotating_F.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
9,476

edits