1 | import THREE from './Three';
|
2 | export default class Renderer extends THREE.WebGLRenderer {
|
3 | constructor({ gl: context, canvas, pixelRatio = 1, clearColor, width, height, ...props }) {
|
4 | const inputCanvas = canvas ||
|
5 | {
|
6 | width: context.drawingBufferWidth,
|
7 | height: context.drawingBufferHeight,
|
8 | style: {},
|
9 | addEventListener: (() => { }),
|
10 | removeEventListener: (() => { }),
|
11 | clientHeight: context.drawingBufferHeight,
|
12 | };
|
13 | super({
|
14 | canvas: inputCanvas,
|
15 | context,
|
16 | ...props,
|
17 | });
|
18 | this.setPixelRatio(pixelRatio);
|
19 | if (width && height) {
|
20 | this.setSize(width, height);
|
21 | }
|
22 | if (clearColor) {
|
23 |
|
24 | this.setClearColor(clearColor);
|
25 | }
|
26 | }
|
27 | }
|
28 |
|
\ | No newline at end of file |