Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
815.8 Developer Tools
ird and nally, we will use emscripten_set_main_loop_arg and the address
of our populated argument struct:
Listing 5.6 Use emscripten_set_main_loop_arg.
void ESUTIL_API esMainLoop (ESContext *esContext)
{
#ifdef __EMSCRIPTEN__
struct loop_vars_t args = {0};
args.totaltime = 0.0f;
args.frames = 0;
args.esContext = esContext;
gettimeofday(&args.t1, &args.tz);
emscripten_set_main_loop_arg(render, &args, 0, 1);
#else
...
At this point, building should give us an error that emscripten_set_main_
loop_arg has not yet been dened. Make sure to #include "emscripten.h" at the
top of Common/esUtil.c. Emscripten will automatically know how to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079