-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (25 loc) · 751 Bytes
/
Copy pathapp.js
File metadata and controls
29 lines (25 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
var Demo;
function Init() {
var canvas = document.getElementById('gl-surface');
var gl = canvas.getContext('webgl');
if (!gl) {
console.log('Failed to get WebGL context - trying experimental context');
gl = canvas.getContext('experimental-webgl');
}
if (!gl) {
alert('Your browser does not support WebGL - please use a different browser\nGoogleChrome works great!');
return;
}
var canvasImage = document.getElementById('imageE');
var context = canvasImage.getContext('2d');
Demo = new LightMapDemoScene(gl,context);
Demo.Load(function (demoLoadError) {
if (demoLoadError) {
alert('Could not load the demo - see console for more details');
console.error(demoLoadError);
} else {
Demo.Begin();
}
});
}