Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. this.setSize = function ( width, height, updateStyle ) {
  2.  
  3. _canvas.width = width * this.devicePixelRatio;
  4. _canvas.height = height * this.devicePixelRatio;
  5.  
  6. if ( this.devicePixelRatio !== 1 && updateStyle !== false ) {
  7.  
  8. _canvas.style.width = width + 'px';
  9. _canvas.style.height = height + 'px';
  10.  
  11. }
  12.  
  13. this.setViewport( 0, 0, width, height );
  14.  
  15. };
  16.  
  17. this.setViewport = function ( x, y, width, height ) {
  18.  
  19. _viewportX = x * this.devicePixelRatio;
  20. _viewportY = y * this.devicePixelRatio;
  21.  
  22. _viewportWidth = width * this.devicePixelRatio;
  23. _viewportHeight = height * this.devicePixelRatio;
  24.  
  25. _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight );
  26.  
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement