Structure of the WebGL examples

We have improved the structure of the code examples in this chapter. As the complexity of our WebGL applications increases, it is wise to have a good, maintainable, and clear design. We have left this section at the end of the chapter so you can use it as a reference when working on the exercises.

Structure of the WebGL examples

Just like in previous exercises, our entry point is the runWebGLApp function which is called when the page is loaded. There we create an instance of WebGLApp, as shown in the previous diagram.

WebGLApp

This class encapsulates some of the utility functions that were present in our examples in previous chapters. It also declares ...

Get WebGL Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.