xeolabs / scenejs

An extensible WebGL-based 3D engine. This is an archived project.
https://xeolabs.github.io/scenejs/
Other
649 stars 165 forks source link

SceneJS creates a lot of global variables #343

Open tsherif opened 9 years ago

tsherif commented 9 years ago

In working with some of the examples, I noticed that SceneJS creates a lot of global variables. In the Quick Start teapot, for example, SceneJS creates the 138 global variables listed below.

The naming convention used for these variables lends itself well to modularization. I could imaging the library creating a single SceneJS object with everything else nested as properties of that object, e.g. SceneJS_Canvas becomes SceneJS.Canvas, SceneJS_error becomes SceneJS.error, SceneJS_math_Frustum becomes SceneJS.math.Frustum, etc. This could make it much cleaner to include SceneJS in other pages.

The full list of global variables created by SceneJS in the teapot example:

nat-n commented 9 years ago

+1