ohzi-core 6.9.0 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.module.js +1 -1
- package/build/index.module.js.map +1 -1
- package/package.json +1 -1
- package/src/Graphics.js +9 -2
- package/src/RenderLoop.js +3 -5
- package/types/RenderLoop.d.ts +0 -1
package/package.json
CHANGED
package/src/Graphics.js
CHANGED
|
@@ -34,12 +34,14 @@ class Graphics
|
|
|
34
34
|
premultipliedAlpha: true,
|
|
35
35
|
preserveDrawingBuffer: true,
|
|
36
36
|
powerPreference: 'high-performance',
|
|
37
|
-
logarithmicDepthBuffer: false
|
|
37
|
+
logarithmicDepthBuffer: false,
|
|
38
|
+
force_webgl2: true,
|
|
39
|
+
xr_enabled: false
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
Object.assign(this.context_attributes, context_attributes);
|
|
41
43
|
|
|
42
|
-
if (context_attributes.force_webgl2)
|
|
44
|
+
if (this.context_attributes.force_webgl2)
|
|
43
45
|
{
|
|
44
46
|
this.canvas_context = canvas.getContext('webgl2', this.context_attributes) ||
|
|
45
47
|
canvas.getContext('webgl', this.context_attributes) ||
|
|
@@ -60,6 +62,11 @@ class Graphics
|
|
|
60
62
|
context: this.canvas_context
|
|
61
63
|
});
|
|
62
64
|
|
|
65
|
+
if (this.context_attributes.xr_enabled)
|
|
66
|
+
{
|
|
67
|
+
this._renderer.xr.enabled = true;
|
|
68
|
+
}
|
|
69
|
+
|
|
63
70
|
this._renderer.autoClear = false;
|
|
64
71
|
|
|
65
72
|
this._renderer.setPixelRatio(1);
|
package/src/RenderLoop.js
CHANGED
|
@@ -12,8 +12,6 @@ export default class RenderLoop
|
|
|
12
12
|
{
|
|
13
13
|
target_application = target_application || new BaseApplication();
|
|
14
14
|
|
|
15
|
-
this._frame_id = -1;
|
|
16
|
-
|
|
17
15
|
this.target_application = target_application;
|
|
18
16
|
this.graphics = graphics;
|
|
19
17
|
|
|
@@ -50,7 +48,6 @@ export default class RenderLoop
|
|
|
50
48
|
|
|
51
49
|
// ###### END CYCLE #######
|
|
52
50
|
|
|
53
|
-
this._frame_id = requestAnimationFrame(this.update.bind(this));
|
|
54
51
|
this.target_application.on_frame_end();
|
|
55
52
|
this.frames_passed++;
|
|
56
53
|
|
|
@@ -69,7 +66,8 @@ export default class RenderLoop
|
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
this.is_running = true;
|
|
72
|
-
|
|
69
|
+
|
|
70
|
+
this.graphics._renderer.setAnimationLoop(this.update.bind(this));
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
stop()
|
|
@@ -79,7 +77,7 @@ export default class RenderLoop
|
|
|
79
77
|
this.is_running = false;
|
|
80
78
|
this.target_application.on_exit();
|
|
81
79
|
|
|
82
|
-
|
|
80
|
+
this.graphics._renderer.setAnimationLoop(null);
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
set_state(new_state)
|