forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateScene.js
37 lines (30 loc) · 1010 Bytes
/
createScene.js
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
30
31
32
33
34
35
36
37
/*global define*/
define([
'Core/clone',
'Core/defaultValue',
'Scene/Scene',
'Specs/createCanvas'
], function(
clone,
defaultValue,
Scene,
createCanvas) {
"use strict";
function createScene(options) {
options = clone(defaultValue(options, {}), true);
options.canvas = defaultValue(options.canvas, createCanvas());
options.contextOptions = defaultValue(options.contextOptions, {});
var contextOptions = options.contextOptions;
contextOptions.webgl = defaultValue(contextOptions.webgl, {});
contextOptions.webgl.antialias = defaultValue(contextOptions.webgl.antialias, false);
var scene = new Scene(options);
// Add functions for test
scene.renderForSpecs = function(time) {
scene.initializeFrame();
scene.render(time);
return scene.context.readPixels();
};
return scene;
}
return createScene;
});