The following diagram presents the architecture that has been built throughout the book:
Globals.js: Defines the global variables
gl (WebGL context),
prg (ESSL program), and the canvas width (
c_width) and height (
Utils.js: Contains auxiliary functions such as
getGLContext which tries to create a WebGL context for a given HTML5 canvas.
WebGLApp.js: It provides three function hooks, namely:
configureGLHook, loadSceneHook, and
drawSceneHook that define the life cycle of a WebGL application.
configure:Here we create cameras, ...