Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.setSize = function ( width, height, updateStyle ) {
- _canvas.width = width * this.devicePixelRatio;
- _canvas.height = height * this.devicePixelRatio;
- if ( this.devicePixelRatio !== 1 && updateStyle !== false ) {
- _canvas.style.width = width + 'px';
- _canvas.style.height = height + 'px';
- }
- this.setViewport( 0, 0, width, height );
- };
- this.setViewport = function ( x, y, width, height ) {
- _viewportX = x * this.devicePixelRatio;
- _viewportY = y * this.devicePixelRatio;
- _viewportWidth = width * this.devicePixelRatio;
- _viewportHeight = height * this.devicePixelRatio;
- _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight );
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement