borismus / webvr-boilerplate

A starting point for web-based VR experiences that work on all VR headsets.
Apache License 2.0
1.8k stars 451 forks source link

Config should be passed as an argument as opposed to a global variable #100

Closed zya closed 8 years ago

zya commented 8 years ago

At the moment the config is a global variable WebVRConfig. It would be nicer if you could just pass it in as an argument to the manager. I think this also applies to webvr-polyfill.

var manager = new WebVRManager(renderer, effect, options); 
borismus commented 8 years ago

The reason we currently use WebVRConfig is that the polyfill is completely invisible to the developer.

All of the WebVRConfig options pertaining to the boilerplate could be converted to an options array, but then there would be two different ways of configuring.

On Wed, Jan 6, 2016 at 3:15 AM Ehsan Ziya notifications@github.com wrote:

At the moment the config is a global variable WebVRConfig. It would be nicer if you could just pass it in as an argument to the manager. I think this also applies to webvr-polyfill.

var manager = new WebVRManager(renderer, effect, options);

— Reply to this email directly or view it on GitHub https://github.com/borismus/webvr-boilerplate/issues/100.

iambumblehead commented 8 years ago

The polyfill is invisible to the developer and so the developer manages the visible and unusual step of defining a global configuration.