Class Engine
Provides an entry point for BenchGL library.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Engine(canvasId, options, effects, events, debug, onError, onLoad)
Creates an instance of BenchGL.
|
Class Detail
Engine(canvasId, options, effects, events, debug, onError, onLoad)
Creates an instance of BenchGL.
- Parameters:
- {String} canvasId
- The id of the canvas that WebGL exploits.
- {Object} options Optional
- General options for initializing the library.
- {Object} options.context Optional
- The options for the WebGL context.
- {Object} options.program Optional
- The options for the shader program.
- {String} options.program.type Optional, Default: 'defaults'
- The type of shader program.
- {String} options.program.vertex Optional
- The vertex shader source.
- {String} options.program.fragment Optional
- The fragmente shader source.
- {String} options.camera Optional
- The options for the camera.
- {Number} options.camera.fovy Optional, Default: 45
- The field of view angle for the camera.
- {Number} options.camera.near Optional, Default: 0.1
- The near clipping plane for the camera.
- {Number} options.camera.far Optional, Default: 100
- The far clipping plane for the camera.
- {Object} effects Optional
- Special effects for the rendering engine.
- {Object} events Optional
- Functions to eventually handle user events.
- {Boolean} debug Optional, Default: false
- Is debug active?
- {Function} onError Optional
- Callback function to call on errors.
- {Function} onLoad Optional
- Callback function to call after loading succesfully.