FANDOM


DefinitionEdit

The viewport() method sets the viewport.

SyntaxEdit

gl.viewport(x, y, width, height)

ParametersEdit

  • x: integer, the default value is 0
  • y: integer, the default value is 0
  • width: non-negative integer
  • height: non-negative integer

ExamplesEdit

// Sets the viewport to be the size of the canvas object
gl.viewport(0, 0, canvas.width, canvas.height);
Community content is available under CC-BY-SA unless otherwise noted.